|
|
Choosing a locale
To determine which locale your application
uses, you can use one of the following methods:
User prompt — You can start the application in some
default locale, and then ask the user to choose their preferred
locale.
Capabilities.languages — The Capabilities.languages property
lists an array of languages available on the user’s preferred languages,
as set through the operating system. The strings contain language tags
(and script and region information, where applicable) defined by RFC4646
(http://www.ietf.org/rfc/rfc4646.txt).
The strings use hyphens as a delimiter (for example, "en-US" or "ja-JP").
The first entry in the returned array has the same primary language
ID as the language property. For example, if languages[0] is
set to "en-US", then the language property is
set to "en". However, if the language property
is set to "xu" (specifying an unknown language),
the first element in the languages array will be different.
Capabilities.language — The Capabilities.language property
provides the user interface language code of the operating system. However,
this property is limited to 20 known languages. And on English systems,
this property returns only the language code, not the country code. For
these reasons, it is better to use the first element in the Capabilities.languages array.
|