International Language Environments Guide for Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Composite Locales

The LC* variables, such as LC_CTYPE or LC_MESSAGES, described in detail in Locale Categories, can also be set in a terminal along with the LANG variable. When set, they override the LANG setting for the particular category. This type of locale setting is called composite locale.

$ export LANG=de_DE.UTF-8
$ export LC_MESSAGES=en_US.UTF-8

In this example, applications that correctly handle the locale settings would operate in German locale but have their localized output printed in English. The output of locale(1) in this case would be as follows:

$ locale
LANG=de_DE.UTF-8 
LC_CTYPE="de_DE.UTF-8" 
LC_NUMERIC="de_DE.UTF-8" 
LC_TIME="de_DE.UTF-8" 
LC_COLLATE="de_DE.UTF-8" 
LC_MONETARY="de_DE.UTF-8" 
LC_MESSAGES=en_US.UTF-8 
LC_ALL=

The LC_MESSAGES variable is in this case printed without apostrophes, indicating that the value is explicitly set. The other LC* variables have their value inherited from the LANG variable. The LC_ALL variable can be used to override all of the LANG and LC* settings. See the locale(1) and setlocale(3C) man pages for more information.