Locales and Languages

The term "language" indicates a collection of properties used in spoken and written communication. Each language has a language name and a language identifier that indicate the particular code page (ANSI, DOS, Macintosh) used to represent the geographical location for the language on the operating system. A neutral language is indicated by a name such as "en" for English. A more geographically specific language can be indicated by a name that includes both locale and country/region information. For example, the locale English (United States) has the language name "en-US".

A "locale" is a collection of language-related user preference information represented as a list of values. Windows XP supports more than 150 locales, and Windows Vista supports about 200. Each locale is defined by a language and a sort order, and has both a locale name and a locale identifier. An example of a locale name for German (Germany) is "de-DE_phonebook".

Each operating system has at least one installed locale and often has many locales from which the user can select. Each locale has a variety of information associated with it, other than its name and identifier. Locale information types are described in Locale Information Constants.

The operating system assigns a locale to each thread, initially assigning the "system default locale," defined by LOCALE_SYSTEM_DEFAULT. This locale is set when the operating system is installed or when the user selects it using the regional and language options portion of the Control Panel. When running a thread in a process belonging to the user, the operating system assigns the "user default locale" to the thread. This locale is defined by LOCALE_USER_DEFAULT. An application can override either default by using the SetThreadLocale function to explicitly set the locale for a thread.

Implementation of a language requires a corresponding locale. The operating system implements a neutral language by selecting the data for the locale associated with a specific version of the language, usually the most widespread locale.

Starting with Windows Vista, it is possible for a particular language to correspond to a supplemental locale, which is a type of custom locale. Since supplemental locales all share a single locale identifier, your applications should handle these locales and the corresponding languages by name instead of by identifier.

Language concepts are closely related to locale concepts, but the two terms are not interchangeable. As a general rule, functions related to the Multilingual User Interface deal with languages, while the NLS functions act upon locales.

The following topics are covered in this section:

About National Language Support

Code Pages

Locale Information Constants

Multilingual User Interface

Table of Geographical Locations

User Interface Language Management