skip to main content
Internationalization, Localization, and Unicode : Internationalization and Localization : Locale
 

Locale

A locale represents the language and cultural data chosen by the user and dynamically loaded into memory at run time. The locale settings are applied to the operating system and to subsequent application launches.
While language is a fairly straightforward item, cultural data is a little more complex. Dates, numbers, and currency are all examples of data that is formatted according to cultural expectations. Because cultural preferences are bound to a geographic area, country is an important element of locale. Together these two elements (language and country) provide a precise context in which information can be presented. Locale presents information in the language and form that is best understood and appreciated by the local user.

Language

A locale's language is specified by the ISO 639 standard. The following table lists some language codes in the standard.
Language Code
Language
en
English
nl
Dutch
fr
French
es
Spanish
zh
Chinese
ja
Japanese
vi
Vietnamese
Because language is correlated with geography, a language code might not capture all the nuances of usage in a particular area. For example, French and Canadian French may use different phrases and terms to mean different things even though basic grammar and vocabulary are the same. Language is only one element of locale.

Country

The locale's country identifier is also specified by an ISO standard, ISO 3166, which describes valid two-letter codes for all countries. ISO 3166 defines these codes in uppercase letters. The following table lists some language codes in the standard.
Country Code
Country
US
United States
FR
France
IE
Ireland
CA
Canada
MX
Mexico
The country code provides more contextual information for a locale and affects a language's usage, word spelling, and collation rules.

Variant

A variant is an optional extension to a locale. It identifies a custom locale that is not possible to create with just language and country codes. Variants can be used by anyone to add additional context for identifying a locale. The locale en_US represents English (United States), but en_US_CA represents even more information and might identify a locale for English (California, U.S.A). Operating system or software vendors can use these variants to create more descriptive locales for their specific environments.