Difference between revisions of "Extensions.I18n.Translate"

From emotive
Jump to navigation Jump to search
Line 19: Line 19:
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| TrasnlationKey | [[Extensions.I18n.TranslationKey|TranslationKey]] | [[Term]] | - | [1] | This element represents a unique key that the system shall use to search its internal database for a translation.}}
+
{{TableRowPropertie1| TranslationKey | [[Extensions.I18n.TranslationKey|TranslationKey]] | [[Term]] | - | [1] | This element represents a unique key that the system shall use to search its internal database for a translation.}}
 
{{TableRowPropertie2| Arguments| [[TranslationArguments]] | [[Term]] | - | [0..1] | This optional element represents a list of arguments for the translation.}}
 
{{TableRowPropertie2| Arguments| [[TranslationArguments]] | [[Term]] | - | [0..1] | This optional element represents a list of arguments for the translation.}}
 
|}
 
|}

Revision as of 11:13, 28 September 2018

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(TrasnlationKey, TranslationArguments);

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 shall return a localized string in the current user language.

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

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

I18n.TranslationKey TranslationKey1;
String String1 = "";

/// Flow

TranslationKey1 = I18n.CreateTranslationKey("TEXT_1");
String1 = I18n.Translate(TranslationKey1);

See also

CreateTranslationKey
TranslateToLocale
CompareUntranslatedString