Classification
OTL Syntax
StringTerm I18n.TranslateToLocale(StringTerm locale, TranslationKeyTerm translationKey, {Term[ ] arguments});
Description
The TranslateToLocale term has a similar function as the Translate term, but instead of using the current locale it shall use a target locale that is given as an argument to the call, formed after the rules of the ISO 639-1 standard.
|
|
NOTE – If the format message is invalid, or if an argument in the arguments element is not of the type expected by the format element(s) that use it, an i18nException shall be thrown.
|
Return Value
The Term returns the value, see table below.
|
|
In OTX, Terms are categorized according to its return data type!
|
Data Type |
Description
|
String |
Localized string in the specified user language.
|
Properties
Name |
Data Type |
Class |
Default |
Cardinality |
Description
|
Locale |
String |
Term |
- |
[1] |
The translation process shall use this string as the target locale for the translation.
|
TranslationKey |
TranslationKey |
Term |
- |
[1] |
This element represents a unique key that the system shall use to search its internal database for a translation.
|
Arguments |
TranslationArguments |
Term |
- |
[0..1] |
This optional element represents a list of arguments for the translation.
|
OTL Examples
/// Local Declarations
I18n.TranslationKey TranslationKey1;
String String1 = "";
/// Flow
TranslationKey1 = I18n.CreateTranslationKey("TEXT_1");
String1 = I18n.TranslateToLocale("en-US", TranslationKey1);
See also
CreateTranslationKey
Translate
CompareUntranslatedString