Child pages
  • 4.4 Localization
Skip to end of metadata
Go to start of metadata

System localization
A locale determines language and encoding for system and programs' messages, representation of dates and so on.
OpenIndiana stores default (system) locale settings in /etc/default/init file. So, if you want to change them after install, you should edit this file and reboot your system.
To ensure that a desired locale is present on your system, you can use locale command.

$ locale -a 
C
POSIX
en_AU
en_AU.ISO8859-1
en_AU.UTF-8
en_CA
en_CA.ISO8859-1
en_CA.UTF-8
en_GB
en_GB.ISO8859-1
en_GB.ISO8859-15
en_GB.ISO8859-15@euro
en_GB.UTF-8
en_IE
en_IE.ISO8859-1
en_IE.ISO8859-15
en_IE.ISO8859-15@euro
en_IE.UTF-8
en_MT.UTF-8
en_NZ
en_NZ.ISO8859-1
en_NZ.UTF-8
en_US
en_US.ISO8859-1
en_US.ISO8859-15
en_US.ISO8859-15@euro
en_US.UTF-8
.....

If the desired locale is not present, you should install it. For example, to install Russian locale from package repository, use the following command
# pkg install system/locale/support/russian

For example, to set Russian locale and Moscow timezone, you should set the following variables in /etc/default/init fle:

TZ=Europe/Moscow
LC_COLLATE=ru_RU.UTF-8
LC_CTYPE=ru_RU.UTF-8
LC_MESSAGES=C
LC_MONETARY=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8

Here C_COLLATE determines text sorting order,
LC_CTYPE determines character classification, for example this setting is necessary for tolower (3C) to work correctly,
LC_MESSAGES determines language for system messages (usually you don't want to change it - it is important to read them even if your environment is mangled in any way),
LC_MONETARY determines currency symbols and name,
LC_NUMERIC determines representation of numeric data (for example, use "." or "," as decimal separator),
LC_TIME determines date and time representation and settings (e.g., first day of the week),
TZ determines current timezone.

To set TZ variable you can use tzselect program.
It will ask you questions about your region, country and time zone and output detailed information about selected timezone, including suitable TZ value (for example, Europe/Moscow), which you can substitute in /etc/default/init file.

GDM localization
GDM (Gnome Display Manager) is a default graphical display manager in OpenIndiana. Usually it uses system locale and allows user to choose any locale available in the operating system. Sometimes you wish to customize this list, in particular, specify default locale and present user only a short list of available languages. It may be useful when you are not sure in the quality of different locales and want to make available for users only locales which were thoroughly tested with your applications.
User configuration file for GDM is /etc/X11/gdm/custom.conf. It is a "ini" file with several sections. Login screen configuration is contained in [greeter] section. Sample is provided below.

[greeter]
ShowGnomeFailsafeSession=false
ShowXtermFailsafeSession=false
ShowLastSession=false
DefaultLocale=ru_RU.UTF-8
LocaleFile=/etc/X11/gdm/locale.alias
UseInvisibleInEntry=true

Here we can eliminate unnecessary for an end user sessions from gdm's list (failsafe sessions, last session) and specify default locale. Also we can provide path to locale.alias file. We can provide our own file, which may be created as a cut down version of standard file (/usr/share/gdm/locale.aliases). By removing unnecessary locales from this file we force GDM to avoid proposing them to the end user.

Russian                 ru_RU.UTF-8
English                 C
English1                POSIX
English(USA)            en_US.UTF-8,en_US
  • No labels

2 Comments

  1. I want to set

    LANG=en_US.UTF-8

    LC_CTYPE=zh_CN.UTF-8

    in /etc/default/init

    but it does not work

  2. Hi,

    it looks like this has been changed in (at least latest) /hipster repository to reflect Solaris 11 changes described here (/etc/default/init is not used any more?):

    So, i had nothing:

    $ pkg facet
    FACETS          VALUE

    then I have added some of them (used output from locale -a to pick up value):

    $ pfexec pkg change-facet -v facet.doc.man=True
    $ pfexec pkg change-facet -v facet.doc.info=True
    $ pfexec pkg change-facet -v facet.locale.sr=True
    $ pfexec pkg change-facet -v facet.locale.sr_RS=True

    and (after some time - it runs very slow and log time):

    $ pkg facet
    FACETS             VALUE
    facet.locale.sr_RS True
    facet.locale.sr    True
    facet.doc.info     True
    facet.doc.man      True

    not sure if this is correct, that is why I am posting this here.

    For OpenIndiana, it is not clear if I needed to reboot (did, just for any case) or if updates will modify facets too.... as well what will happen if I add facet.locale.en and facet.locale.en_US.

    One is for sure, /hipster version doesn't obey /etc/default/init (changed and rebooted, no effect)!  Also, (in Oracle doc page) mentioned environment service is not present in OI.

    Regards.