|Skip Navigation Links|
|Exit Print View|
|International Language Environments Guide for Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library|
You can change the locale in a terminal session by setting the LANG variable as follows:
$ export LANG=locale
For example, to change to the de_DE.UTF-8 locale, you would type:
$ export LANG=de_DE.UTF-8
To verify the locale has been successfully changed, run the locale(1) command:
$ 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="de_DE.UTF-8" LC_ALL=
To obtain the list of locales available in a system, run the following command:
$ locale -a
To install more locales, see Installing Additional 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.