Extensions.I18n.Translate

From emotive
Jump to navigation Jump to search

Classification

Name Translate
Short Description Returns a localized string from a TranslationKey
Class Term
Extension OTX i18n extension
Group Translation related terms
Exceptions -
Checker Rules -
Standard Compliant Yes

OTL Syntax

StringTerm I18n.Translate(TranslationKeyTerm translationKey, {Term[ ] arguments});

Description

The Translate term accepts a TranslationKey which may be supplemented by additional translation arguments for message parameter substitution (if required by the associated thesaurus entry). It will return a localized string in the current user language.

Icons Note.png 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 will be thrown.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
String Localized string in the current user language.

Properties

Name Data Type Class Default Cardinality Description
TranslationKey TranslationKey Term - [1] This element represents a unique key that the system will use to search its internal database for a translation.
Arguments Term 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.Translate(TranslationKey1);

See also

CreateTranslationKey
TranslateToLocale
CompareUntranslatedString