Platform SDK: International Features |
The national language support functions let applications:
National language support also includes support for keyboard layouts and language-specific fonts. For more information about these topics, see Keyboard Input and Fonts and Text.
The following topics are covered in this section:
There are a number of terms that are important when discussing national language support. The following table summarizes information on locales and languages. Additional comments follow the table.
Language group |
System locale |
User locale |
Thread locale |
Input locale |
UI language | ||
---|---|---|---|---|---|---|---|
System | User | ||||||
Purpose: | Provides all keyboard layouts, IMEs, TrueType fonts, font links, LPKs, bitmap fonts and code page translation tables needed by the system for a group of languages. Therefore impacts all other settings in this list. | Determines which bitmap fonts, and OEM, ANSI, and MAC code pages are defaults for the system. This only affects applications that are not fully Unicode. | Determines which settings are used for formatting dates, times, currency, and numbers as a default for each user. Also determines the sort order for sorting text. | Determines which settings are used for formatting dates, times, currency, and large numbers for a thread. Also determines the sort order for sorting text. | A pair consisting of language and a method of input. | Determines the default language of menus and dialogs, messages, INF files, and help files of Windows 2000. | Non-MUI: Same as System UI Language. |
MUI: Determines the language of menus and dialogs, messages, and help files of Windows 2000. | |||||||
FIRST SET: | Installation | Installation | Installation | Default to user locale | Installation | Installation | Non-MUI: Installation |
MUI: Installation | |||||||
How to Change: | Regional Options (CP) (only administrators) |
Regional Options (CP) (only administrator) | Regional Options (CP) | SetThread Locale |
Regional Options (CP) | No | Non-MUI: No |
MUI:Regional Options (CP) | |||||||
Default: | Western Europe and United States and language group required to display language of a localized version. | Locale matching language of localized version. | Locale matching language of localized system. | User Locale | Language of localized version with default input method. | Language of localized Version. | Language of localized Version. |
API: | EnumSystem Language Groups |
GetSystem Default LangID |
GetUser Default LangID |
GetThread Locale |
GetKeyboard Layout |
GetSystem DefaultUI Language |
GetUser DefaultUI Language |
The language group controls which system locale, user locales, input locales, and user interface (UI) languages can be selected. For example, Windows 2000 installs the Western Europe and United States language group by default. This default cannot be removed. For each localized version, the specified language group is the default and cannot be removed. Thus, if the English version of Windows 2000 is installed in a non-English country, the user will typically install another language group.
When adding a language group, Windows 2000 copies (but does not activate) the necessary keyboard files, Input Method Editors (IMEs), TrueType Font files, bitmap font files, and National Language Support (.nls) files. Adding a language group also adds registry values for font linking and installs scripting engines for complex script languages (Arabic, Hebrew, Indic, and Thai).
In addition to the Western Europe and United States language group there are 16 other language groups:
Any number and combination of language groups can be installed on any Windows 2000 version. For example, a Spanish user would install the Cyrillic language group to work on Russian texts. In this case, the word processing application needs to support the Cyrillic language group also.
Note, adding the appropriate language group will not automatically enable an application to accept text. Testing is recommended. For example, applications that are not completely Unicode-compliant might require the system locale to be changed.
A locale is either a language or a language in combination with a country. Windows 2000 supports more than 150 locales.
The system locale determines which code pages (ANSI, DOS, Macintosh) are used on the system by default. To select a system locale, the appropriate language group must be installed; that is, you need the script support to select a system locale. The system locale setting affects only applications that are not fully Unicode-compliant. This is because setting the system locale to a certain language instructs Windows 2000 to emulate a non-Unicode-based operating system (for example, DOS, Windows 3.1, Windows 95/98) localized to this language. Changing the system locale installs the necessary bitmap font files to support non-Unicode applications in the specified language. The system locale is a per-system setting and requires a restart to be implemented.
Sometimes there is no noticeable difference between two system locales. For example, this is the case with the German-Standard and German-Austria system locales. In general, system locales of one language group are very similar and may only differ in the OEM or MAC code page.
An ANSI application should check the system locale during installation. The following are some examples of system locale settings:
The user locale determines default sort order and the default settings for formatting dates, times, currency, and numbers. Although it is presented as a language (some in combination with a country), it is not a language setting. For example, setting the user locale to Hebrew means that the user wants to use the formatting conventions of Hebrew, not necessarily the Hebrew language. In addition, the user locale determines the string that is used for the names of the days and months. For example, if a user displays 'November 25, 1998,' the 'November' string could change based on the user locale. Changing the user locale automatically adds an input locale with the default settings for the language.
An application should typically use the user locale settings to display data. However, in some cases an application may want to use a fixed locale to display data. This can be done by setting the thread locale to a fixed value during initialization of the application. For example, an English user using English Windows 2000 working in Rome could select Italian (Italy) as the user locale to get formatting conventions for Italy.
The thread locale defaults to the user locale and determines the formatting of dates, times, currency, and large numbers for the thread. It can be changed programmatically using the API SetThreadLocale. In most cases the thread locale should not be overwritten. For example, a financial stock trading application for the New York Stock Exchange, which is used in banks worldwide, has to display the time, date, and stock prices in US formats. This application uses SetThreadLocale to set the thread locale to English (United States) and can use the NLS APIs to format dates, times, and stock prices.
The input locale describes a language the user wants to enter (not limited to typing) and the method of input. There can be multiple input locales installed and the user can switch between them.
The default input locale is the localized language of the OS, and it is the setting that is active when a new application is started (or in some applications when a new window is opened). Switching to a different input locale is done on a per-application basis; that is, you can have two different input locales in two different applications. For example, a user can type German using the international US keyboard layout, English using voice input (with third party software), and Spanish using an Input Method Editor (IME ) in three different applications.
A language is identified by a LANGID, which is composed of a primary language (for example,Swiss) and a sublanguage (for example, Swiss German).
The system UI language is the language of the localized version that was used to set up Windows 2000 (that is, the install language). All menus, dialog boxes, error messages, and help files are in this language, except on Windows 2000 multilanguage user interface (MUI), where the user can select a different language.
The user UI language determines the UI language that the system displays. In most cases, this is the same as the system UI language. However, for the Windows 2000 MUI, it can be different.
Windows 2000 MUI allows a user to change the language of the user interface. A user using MUI can change the UI language through the Regional Options in Control Panel. If a user changes the user UI language, the user will have to log off and then log back on to see the effect .For example, a multinational corporation wants to deploy Windows 2000 on all of its subsidiaries. The company creates a global install job, which installs the English language version of Windows 2000 on all clients, regardless of location. At the same time, it installs specific language modules depending on the organizational unit of which the computer is a member. When the user logs on the first time to his newly installed system, Windows 2000 will appear like a localized version.
A code page is an ordered set of characters in which a numeric index (also known as a code point value) is associated with each character. The first 128 characters of each code page are functionally the same and include all characters needed to type English text. The upper 128 characters of OEM and ANSI code pages contain characters used in a language or group of languages.