Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6

JEMHCloud users can localize or customize emails changing the labels. You can use this feature if you want to:

  • Change the email notification language.
  • Use the user's language inferring it from its email address. 
  • Change one or more labels in the system templates.

Changing Notification Default Language

In this guide, we will create a new Translation changing JEMHCloud notification language to Spanish. 

  1. Go to Notifications > Translations -> Create
  2. Select a Language or Locale for reference. Spanish in our case, but you can be more specific selecting the country as well.  
  3. Leave email regexes empty to use this language as default for notifications
  4. System labels are pre-loaded in the content field, from where you can change/translate the values into the required language.  

Message Bundle Format

When the content is edited, it comprises of simple key/values:

velocity.macro.action.header.emailUser=Usuario de Email
velocity.macro.action.header.support=Soporte
velocity.macro.action.header.by=través de
velocity.macro.action.header.anonymous=Anónimo
velocity.macro.action.footer.addComment.title=Agregar Comentario
velocity.macro.action.footer.addComment=Agregar Comentario
velocity.macro.action.footer.signature=Este mensaje a sido enviado usando JEMHCloud

Creating a Translation

Translations are located under Notifications > Templates, creating a new one allows you to define the locale (informational only) and set regexps matching email domains that when sent to will use this message bundle.

The first translation added will become the default for all message key expansions, and will be used if no regexp addresses match or a key is not found in earlier bundles.  By customizing the default to a localized language, the system default English can be translated into whatever default is required.

Example Expressions

The regexps must be formatted correctly, for example:

Match one domain.*@yourdomain\.es
Match one or more.*@yourdomain\.(es|br)
Match all domains.*

 

When saved, the entry will be shown:

(info) The 'All Keys Matched' indicator asserts that this bundle has all the keys that the system template has.  If the system templates are updated, a link will be available to automatically add the missing keys.

Example Mail Content

In the above example, when sending any email from JEMHCloud, its language will be in Spanish:

Custom Translations by recipient email address

In a similar way, you can create a translation that will be activated depending on the recipient's email address.  In this guide we will provide a translation for french speakers. 

  1. Go to Notifications > Translations -> Create
  2. Select a Language or Locale for reference, French in this case.
  3. Enter regular expression CSV matching known French speaking domains. For example: .*\.fr, .*\.be, .*\.lu, .*\.cd, .*\.lu,  .*\.ne
  4. System labels are pre-loaded in the content field. Translate labels to French and save.

Translations configuration looks like:

Notifications sent to email addresses matching the French regexes (domains) will be in French.

  • You can use translations to customize JEMHCloud system labels. Create an English translation with no email regexes and change the labels like 'velocity.macro.action.footer.signature'
  • If you're creating your own custom template, you can use this feature replacing static texts in your template for $messageUtils.getMessage("yourCompany.someKey"). You will need to create your own translation adding key=label pairs, when doing so, it's recommended to use a prefix to avoid possible key collision. Note: JEMHCloud is not able to detect missing custom keys in translations.

    yourCompany.someKey=The static text

  • JEMHCloud uses JIRA's names when resolving field names in English. Although they are not defined in the system default, they can be translated. Have a look at the summary, issuetype, priorty, etc. keys in the Spanish example.
  • Some known issues and improvements around translations are:

  • No labels