JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
International Language Environments Guide for Oracle Solaris 11.1     Oracle Solaris 11.1 Information Library
PDF
search filter icon
search icon

Document Information

Preface

1.  Introduction

2.  Unicode and UTF-8 Locale Support

3.  Working with Languages and Locales

Locale Selection in GNOME Display Manager

How to Select a Locale in GNOME Desktop Manager

How to Start a Session in a Different Language

Setting the Locale in a Terminal Session

Composite Locales

Installing Additional Locales

Locale Facets

What Is a Facet?

Structure of Locale Facets

How to Add Language Support in Package Manager

Adding Language Support From the Command Line

Setting the System's Default Locale

Legacy Locales

Locale Aliasing

Locale Selection in the Installer

Locale Selection in the Automated Installer

Selecting Locales to Be Installed

Non UTF-8 Locales

Setting the Default System Locale, Keymap and Timezone

4.  Desktop Keyboard Preferences and Input Methods

5.  Configuring Fonts

6.  Advanced Topics

A.  Available Locales

Index

Setting the Locale in a Terminal Session

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.

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.