Difference between revisions of "Extensions.I18n.GetCurrentLocale"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
{{DISPLAYTITLE: '''GetCurrentLocale'''}}[[Category:i18n]] | {{DISPLAYTITLE: '''GetCurrentLocale'''}}[[Category:i18n]] | ||
== Classification == | == Classification == | ||
− | {{ClassificationActivity | GetCurrentLocale | | + | {{ClassificationActivity | GetCurrentLocale | Retrieves the current locale code | [[Term]] | [[Extensions.I18n|OTX i18n extension]] | [[Extensions.I18n#Terms|Locale settings related terms ]] | - | - }} |
== OTL Syntax == | == OTL Syntax == | ||
Line 9: | Line 9: | ||
== Description == | == Description == | ||
− | The '''GetCurrentLocale''' term should retrieve the current locale code that is used by the runtime system. The returned locale code | + | The '''GetCurrentLocale''' term should retrieve the current locale code that is used by the runtime system. The returned locale code shall be a combination of the ISO 639-1 two-letter language code followed by a hyphen, and then the uppercase two letter country code as defined by ISO 3166. Optionally, a variant code may be added in case of additional customizations (headed by another hyphen). The variant codes are not defined by this standard. |
+ | |||
+ | If no current locale is selected, the system shall return the default locale. | ||
{{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Current locale code of the runtime system.}} | {{TermReturnValue| [[Core.DataTypes.SimpleDataType.String|String]] | Current locale code of the runtime system.}} | ||
== Properties == | == Properties == | ||
+ | * NONE | ||
== OTL Examples == | == OTL Examples == | ||
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | <syntaxhighlight lang="java" enclose="div" style="font-size: medium;"> | ||
− | String | + | String String1 = ""; |
− | + | ||
+ | /// Flow | ||
+ | |||
+ | String1 = I18n.GetCurrentLocale(); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== See also == | == See also == | ||
[[Extensions.I18n.GetAllLocales|GetAllLocales]] | [[Extensions.I18n.GetAllLocales|GetAllLocales]] |
Revision as of 09:45, 28 September 2018
Contents
Classification
Name | GetCurrentLocale |
Short Description | Retrieves the current locale code |
Class | Term |
Extension | OTX i18n extension |
Group | Locale settings related terms |
Exceptions | - |
Checker Rules | - |
Standard Compliant | Yes |
OTL Syntax
StringTerm = I18n.GetCurrentLocale();
Description
The GetCurrentLocale term should retrieve the current locale code that is used by the runtime system. The returned locale code shall be a combination of the ISO 639-1 two-letter language code followed by a hyphen, and then the uppercase two letter country code as defined by ISO 3166. Optionally, a variant code may be added in case of additional customizations (headed by another hyphen). The variant codes are not defined by this standard.
If no current locale is selected, the system shall return the default locale.
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 | Current locale code of the runtime system. |
Properties
- NONE
OTL Examples
String String1 = "";
/// Flow
String1 = I18n.GetCurrentLocale();