Localize Templates

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:

 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.

Translation of Values

Allowed values in some fields are static. Examples of these fields are issue type (Bug, Task, New Feature), priority (Major, Critical, Blocker), etc. As you can see, the labels are in English as JIRA provides them.  JEMHCloud allows you to localize these values for notification using the translations. 

Although some fields are user provided, their values are fairly static and you may want to translate them. Example of these fields are Components, Labels, custom check-boxes or radio buttons, custom selects, etc. 

The key of a value translation follows the pattern:

<fieldId>.value.<value>=The translation of <value>

Examples are:

priority.value.Major=Importante issuetype.value.Task=Tarea issuetype.value.New\u0020Feature=Nueva Funcionalidad components.value.My\u0020Component=Mi Componente customfield_10100.value.TheValue=El Valor ....

Spaces are not allowed in keys and they need to be replaced with \u0020

Although the allowed keys depend on your JIRA configuration, the basic set of keys to translate values is:

issuetype.value.Improvement= issuetype.value.Task= issuetype.value.Sub-task= issuetype.value.New\u0020Feature= issuetype.value.Bug= issuetype.value.Improvement= priority.value.Blocker= priority.value.Critical= priority.value.Major= priority.value.Minor= priority.value.Trivial= status.value.Open= status.value.In\u0020Progress= status.value.Reopened= status.value.Resolved= status.value.Closed= status.value.To\u0020Do= status.value.In\u0020Review= status.value.Done=

It's user job to maintain value keys and their translations. JEMHCloud team cannot known all the possible values and it cannot translate them to every language.

 

  • 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.