Go to main content

Internationalizing and Localizing Applications in Oracle Solaris

Exit Print View

Updated: November 2020
 
 

Overview of Locales

A locale is a collection of language and cultural convention data for a specific region. In the context of a UNIX operating system such as Oracle Solaris, the term locale has a specific meaning defined by a set of standards. See the International Language Environments Guide for Oracle Solaris 11.4 for detailed explanation.

C Locale

The C locale, also known as the POSIX locale, is the POSIX system default locale for all POSIX-compliant systems. The Oracle Solaris operating system is a POSIX system. The Single UNIX Specification, Version 3, defines the C locale. Register at http://www.unix.org/version3/online.html to read and download the specification.

    To run the internationalized programs in the C locale use any of the following ways:

  • Unset all locale environment variables. Runs the application in the C locale.

    $ unset LC_ALL LANG LC_CTYPE LC_COLLATE LC_NUMERIC LC_TIME LC_MONETARY LC_MESSAGES
  • Explicitly set the locale to C or POSIX.

    $ LC_ALL=C
    $ export LANG=C

Some applications check the LANG environment variables without actually calling setlocale(3C) to reference the current locale. In this case, shell is explicitly set to the C locale by specifying the LC_ALL and LANG locale environment variables. For the precedence relationship among locale environment variables, see the setlocale(3C) man page.

To check the current locale settings in a terminal environment, run the locale(1) command.

$ locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=  

Locale Categories

The types of locale categories are as follows:

LC_CTYPE

Character classification and case conversion.

LC_TIME

Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.

LC_MONETARY

Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.

LC_NUMERIC

Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.

LC_COLLATE

Specifies a collation order and regular expression definition for the locale.

LC_MESSAGES

Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).

LO_LTYPE

Specifies the layout engine that provides information about language rendering. Language rendering (or text rendering) depends on the shape and direction attributes of a script.

Core Locales

The Oracle Solaris core locales are as follows:

Chinese-Simplified

zh_CN.UTF-8

Chinese-Traditional

zh_TW.UTF-8

English

en_US.UTF-8

French

fr_FR.UTF-8

German

de_DE.UTF-8

Italian

it_IT.UTF-8

Japanese

ja_JP.UTF-8

Korean

ko_KR.UTF-8

Portuguese-Brazilian

pt_BR.UTF-8

Spanish

es_ES.UTF-8

Core locales have better coverage at the level of localized messages than the locales available for additional installation. Oracle Solaris OS components such as Installer are localized only in core locales while localized messages for third-party software such as GNOME or Firefox are often available in more locales.

All locales in the Oracle Solaris environment are capable of displaying localized messages, provided that the localized messages for the relevant language and application are present. Additional locales including their localized messages can be added to the system from the installation repository by modifying the pkg facet properties.