Locale ID
A locale ID is used to name a set preferences for a locale. The identifier is based on BCP47 and Unicode TR 35 for distinguishing among languages, country/region, currencies, time zones, transforms, and so on.
Typically, the ID is a language code or
a language and region code;
such as en
and en-NZ
, respectively. However, ID's can also contain
a script,
extensions and
variants.
Parsing
The Parse and TryParse methods are used to convert the string representation of the ID into the various subtags. MostLikelySubtags returns a new ID with the language, script and region filled in with a likely value.
ID | Most Likely | Description |
---|---|---|
en |
en-Latn-US | English |
en-NZ |
en-Latn-NZ | English in New Zealand |
zh |
zh-Hans-CN | Simplified Chinese |
zh-TW |
zh-Hant-TW | Traditional Chinese in Taiwan |