Solaris Internationalization Guide For Developers

What Is a Locale?

A locale may be composed of both a base language and the country of use. This allows for specific differences by country such as currency units notation.

The key concept for application programs is that of a program's locale. The locale is an explicit model and definition of a native-language environment. The notion of a locale is explicitly defined and included in the library definitions of the ANSII C Language standard.

The locale consists of a number of categories for which there is language-dependent formatting or other specifications. A program's locale defines its codesets, date and time formatting conventions, monetary conventions, decimal formatting conventions, and collation (sort) order.

A locale name contains language, territory, and possibly codeset, although territory is dropped when not needed. Codeset is usually assumed. For example, German is de, an abbreviation for Deutsch, while Swiss German is de_CH, CH being an abbreviation for Confederation Helvetica.


Note -

More than one locale may be associated with a particular language. This allows for regional differences such as currency notation. For example, an English-speaking user in the United States can select the en_US locale (English for the United States). An English-speaking user in Great Britain can select en_GB (English for Great Britain).


Generally the locale name is specified by the LANG environment variable. Locale categories are subordinate to LANG, but may be set separately, in which case they override LANG. If LC_ALL is set, it overrides not only LANG, but all the separate locale categories as well.

Full and Partial Locales

A full Solaris locale has all of the listed functions and the localized system messages in that language. The German de locale is a full locale. A German language user sees all system messages in German.

Partial locales have the listed functions but they don't provide localized messages. For example, the Russian ru locale can process input, output, sorting, and so on, but it does not have localized messages in Russian. For this reason it is a partial locale.

Some partial locales do use non-English messages because there may be a full locale with the localized messages. For example, the de_AT is a partial locale for Austria. Austrians speaks German but use a different currency. The Austrian locale is a subset of the German de locale. It displays messages in German and currency in Austrian shillings instead of German marks.