JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
International Language Environment Guide     Oracle Solaris 11 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

Installing Additional Locales

In a default installation of Oracle Solaris, the following core locales are available, with only one locale per language:

The following sections describe the different ways to add support for additional languages.

Locale Facets

In order to better understand the procedure to install language support in Oracle Solaris 11, you should become familiar with the concept of facets.

What Is a Facet?

In earlier Oracle Solaris releases, the optional components such as documentation, localization or debug files used to be split into separate packages. The Image Packaging System in Oracle Solaris 11 allows Oracle to keep the optional components in the same package using special tags called facets. Facets make the packaging simpler, while keeping disk space usage low if you do not need the additional features. For more information on facets, see Package Variants and Facets in Oracle Solaris 11 Express Image Packaging System Guide

The locale facets are used to mark files or actions that are language or locale specific. For example, in the manifest of the web/wget package, the file /usr/share/locale/ja/LC_MESSAGES/wget.mo is tagged with facet.locale.ja=true. This tag indicates that the file, containing Japanese translations of the wget messages, will only be installed when support for Japanese is enabled by setting the facet.locale.ja facet to true.

Structure of Locale Facets

There is no fixed format for the locale facets. The following convention is used in the Oracle IPS repositories:

facet.locale.{language}[_territory]

language is a two-letter language code from the ISO 639 standard, and territory is a two-letter territory code from ISO 3166.

How to Add Language Support in Package Manager

  1. In the Package Manager window, choose Edit->Preferences.
    image:Package Manager: Preferences
  2. In the Preferences window, select the Optional Components tab.
  3. Select or deselect the desired language.
    image:Package Manager: Optional Components
  4. Click OK.

    All the optional components of the installed packages will be updated automatically.


    Note - Package Manager manages only languages present in the system/locale package. Use the command line to add or remove support for any other language.


Adding Language Support From the Command Line

To add language support from the command line, set the pertinent locale facet with the pkg change-facet command. For example, you would use the following command to add support for French as spoken in France.

You would use the following commands to add support to all available French variants.

Setting the System's Default Locale

In previous Oracle Solaris releases the default system locale was configured in the /etc/default/init file. In Oracle Solaris 11, the settings have been moved to the corresponding properties of the svc:/system/environment:init service. Service properties can be edited using the svccfg(1M) command. For example, to change the default system locale to fr_FR.UTF-8, you would run the following commands:

# svccfg -s svc:/system/environment:init setprop environment/LANG = astring: \
fr_FR.UTF-8

The service has to be refreshed for the change to take effect:

# svcadm refresh svc:/system/environment

The value of the service property can be verified by the following command:

# svccfg -s svc:/system/environment:init listprop environment/LANG

Legacy Locales

While the default system locales in Oracle Solaris use UTF-8 encoding, a number of legacy locales can be used as well.


Note - The GNOME desktop environment supports only UTF-8 locales.


Legacy locale support is contained in the system/locale/extra package. Run the following command to install legacy locale support:

# pkg install pkg:/system/locale/extra

To enable support for a specific language, set the corresponding locale facet to true. For example, to install the da_DK.ISO8859-1 locale (and, in fact, all of the da_DK locales), you would enable facet.locale.da and facet.locale.da_DK as follows:

# pkg change-facet facet.locale.da=True
# pkg change-facet facet.locale.da_DK=True

Locale Aliasing

While the most common locales are usually well supported across the major operating systems, their names are different in many cases. As an example, while Oracle Solaris uses fr_FR.UTF-8 as the locale name for French as spoken in France using UTF-8 encoding, IBM AIX uses FR_FR and HP-UX 11.11 and RHEL 5.4 use fr_FR.utf8. This inconsistency can be burdensome in a heterogeneous environment or when migrating to Oracle Solaris.

To address this issue, support for locale aliases has been introduced in libc in Oracle Solaris 11. Locale name aliases are accepted and mapped to corresponding canonical locale names, if any, during the locale selection process, as specified in setlocale(3C), and message object or message catalog processing, as specified in gettext(1), catopen(3C), and gettext(3C) man pages.

In addition, to provide better compatibility with earlier Oracle Solaris releases, the messaging functions now look for the message object or catalog using the obsolete Solaris locale names, such as fr or fr_FR, as additional locale names to check against. For more information, see “Short Form Locales” in the “Localization” section on the Oracle Solaris 11 - End of Feature Notices page.

A typical use case is a predominantly Linux environment where the Linux style locale name is used in the locale announcement in the user's shell initialization file. For example, the command setenv LANG ja_JP.utf8 is included in $HOME/.login, and the home directory is NFS-mounted. In this network environment, when a user logs into an Oracle Solaris 11 system, the locale alias support mechanism will internally and transparently map the locale name into the corresponding Oracle Solaris locale name, which is ja_JP.UTF-8, and will honor, and support the user-specified locale name. In the same way, when non-Solaris locale names are passed to a remote Oracle Solaris 11 machine through ssh(1), they will be recognized, honored, and supported.

For more details, refer to the locale_alias(5) man page, which also has full lists of locale name mappings.