Difference between revisions of "Extensions.I18n.TranslateToLocale"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE: '''TranslateToLocale '''}}[[Category:i18n]] | {{DISPLAYTITLE: '''TranslateToLocale '''}}[[Category:i18n]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | TranslateToLocale | Returns a localized string from a '''TranslationKey''' after the target locale | [[Term]] | [[Extensions.I18n|OTX i18n extension]] | [[Translation related terms]] | [[ | + | {{ClassificationActivity | TranslateToLocale | Returns a localized string from a '''TranslationKey''' after the target locale | [[Term]] | [[Extensions.I18n|OTX i18n extension]] | [[Translation related terms]] | [[Core.Actions.Throw.Exception.UnsupportedLocaleException|UnsupportedLocaleException]] | - }} |
== OTL Syntax == | == OTL Syntax == |
Revision as of 07:14, 16 February 2016
Contents
Classification
Name | TranslateToLocale |
Short Description | Returns a localized string from a TranslationKey after the target locale |
Class | Term |
Extension | OTX i18n extension |
Group | Translation related terms |
Exceptions | UnsupportedLocaleException |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm = I18n.TranslateToLocale(TrasnlationKey, StringTerm);
Description
The TranslateToLocale term has a similar function as the Translate term, but instead of the current locale, it should use a target locale, which is given as an argument.
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 |
TrasnlationKey | TranslationKey | Term | - | [1] | A unique key that the system uses to locate a translation into internal database. |
locale | String | Term | - | [1] | The translation process is this string as the target locale to use for the translation. |
OTL Examples
String result;
I18n.TranslationKey TranslationKey1;
TranslationKey1 = I18n.CreateTranslationKey("TEXT_1");
result = I18n.TranslateToLocale("vi-VN", TranslationKey1, null);