Business Rules are developed in the base language of the system, indicated by the behavior settings named DEFAULT_LANGUAGE and DEFAULT_REGION. DEFAULT_LANGUAGE normally has the value of en for English. The DEFAULT_REGION normally has the value of US which represents the value for the United States of America. Note that these values are case sensitive. It is unusual to alter these values, but it is usual to define other locales and assign users to these locales. The Translate System Messages and Prompts utility allows for the translation of messages into any locale, which is the combination of the language and region. The allowable locales for any system are defined within the administration utility named Allowed Locales.
In order to localize business rules, special consideration needs to be given and rules for the alternative languages need to be developed.
The following business rule actions may need to be localized, as they typically contain text which is displayed to the end user:
- ERROR
- STOP
- REAUTHORIZE
Consider a business rule in US English, such as this:
{STOP: Your entry is in error. Please correct and submit again}
If you also want to support French and Spanish langauge alternatives that have been added as allowed locales, you may do this:
if (USER.{language}) = 'en') {
{STOP: Your entry is in error. Please correct and submit again}
}
if (USER.{language} = 'fr') {
{STOP: Votre entrée est erronée. Veuillez corriger et soumettre de nouveau }
}
if (USER.{language}) = 'es') {
{STOP: Su entrada está en error. Corrija y envíe de nuevo }
}
If you want to add variants of languages, you will also need to use the user’s region within the logic. For example, if you want to support variants for different versions of English, you might do this:
if (USER.{language}) = 'en' && USER.{region} = 'US') {
{STOP: Your entry for the field named Color is in error. Please correct.}
}
if (USER.{language}) = 'en' && USER.{region} = 'GB') {
{STOP: Your entry for the field named Colour is in error. Please correct.}
}
Note the different spellings for the word Color.