Translations

Source: This article refers to Translations

In a Nutshell

The Translations tab is used to create and manage custom translations that can be used in different places in the application, such as in screen configurations, in business rule actions, or even in widgets for a given company.


Access

The Translations tab can be accessed by navigating to Admin > Company > Translations


A Closer Look

Create Custom Translation

Note: In case the defined language does not exist for the key, the most frequently-used language will be used. In order to ensure there is always a fallback language, it is recommened to define for each key the default language used in the company.

You will need to enter the following information when creating a custom company translation:



Field Description
Clients Default: All. The client on which the custom company translation exists (example: Knowledge Management).
Language Required. The language of the custom company translation.
Key Required. The key associated with the translation string.
Value Required. Required. The custom value used to display the translated text or label on a screen or notification.

You can then add translations in multiple languages and associate them with the key specified above.


Use Custom Translation in Business Rule

The following table describes the syntax for using custom translations in a business rule:

Syntax without Paramaters Syntax with Paramaters
Business Rule ${i18n.translate(<languageCode>,<translationKey>)} ${i18n.translate(<languageCode>,<translationKey>,<param1>,<param2>)}
Translation Value Translation values can consist of any text. HTML is also supported for sending emails.
               <p>Dear ...,</p>
               <p>some text</p>
               <p>some more text</p>
               <p>Sincerely yours,</p>
               <p><strong>
               <span style="color: #3366ff;">
               Name of Sender</span>
               </strong></p>
            


Note: In the translation itself it is also possible to format the text in HTML which will then be applied in the business rule.
To define parameters in a translation value use the following syntax:

Translation Value
Some text {} some more text {} {} some other text
or
Translation Value
Some text {paramname1} some more text {paramname2} {paramname3} some other text

Attention:When using translations with parameters the order of the parameters is relevant.

Sample Business Rule

The following is an example of a business rule used for an assignment rejection email:

Translation Key emailBodyRejected
Translation Value <p>Dear dispatcher,</p><p>The activity was <strong><span style="color: #ff0000;">rejected</span></strong>by the technician.</p><p>Make sure to plan it in again as soon as possible.</p><p>Sincerely yours,</p><p><strong><span style="color: #3366ff;">CALI</span></strong></p>
Code in Business Rule Action ${i18n.translate(businessPartner.language, 'emailBodyRejected')}
Email Text Dear dispatcher, The activity was rejected by the technician. Make sure to plan it in again as soon as possible. Sincerely yours,

Workflow

The first step would be to create the custom translation at Admin > Company > Translations:



You will then reference the custom translation in the business rule action:



And now when the business rule is successfully triggered, the custom translation will be displayed in the message:




Appendix

Translations DTO

Field Name Type Category Constraint Reference Description
code String Optional length >= 1 & length <= 255    
key String Required length >= 1 & length <= 255   Translation key.
language String Required length >= 1 & length <= 255   Language of this translation.
value String Required length >= 1 & length <= 2147483647   Translation value.
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.