Project

General

Profile

Actions

Bug #4501

closed

/hipster localization issues

Added by Predrag Zečević over 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internationalisation
Target version:
-
Start date:
2014-01-17
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Hi,

I have read http://wiki.openindiana.org/oi/4.4+Localization page and since no one reacted to comments, here this bug report.
Currently running latest /hipster:

$ uname -rosv
SunOS 5.11 illumos-483b029 Solaris

This is content of /etc/default/init file:

$ grep -v ^# /etc/default/init | grep .
TZ=Europe/Berlin
CMASK=022
LANG=en_US.UTF-8
LC_ALL=C
LC_MONETARY=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=sr_RS.UTF-8

But it is not consulted at all:
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8" 
LC_NUMERIC="en_US.UTF-8" 
LC_TIME="en_US.UTF-8" 
LC_COLLATE="en_US.UTF-8" 
LC_MONETARY="en_US.UTF-8" 
LC_MESSAGES="en_US.UTF-8" 
LC_ALL=

So, how to set/change localization?

Thank you. Regards.

P.S: This is not really terribly important, but if this cannot be solved, we cannot expect wide use of openindiana (I guess).

Actions #1

Updated by Alexander Pyhalov over 8 years ago

There are a lot of places where these settings can be overwritten - gdm can do it, it can be done in ~/.profile, ssh sometimes can forward LC_* variables and so on.

Actions #2

Updated by Predrag Zečević over 8 years ago

Hi,

I know that. But it is not proper solution.
Regards.

Actions #3

Updated by Ken Mays almost 8 years ago

  • Status changed from New to Closed
  • Assignee changed from OI G11n to Ken Mays
  • % Done changed from 0 to 100

Make sure you reset the environment for DE and have the SUNWde* localization packages loaded. Setting LC_ALL = locale wil override the minor settings (use that as a master switch).

There are three sets of locale settings¹:

LANG, the fallback setting, if you haven't specified a value for a category. It's indended for users to indicate their locale in a simple way.

LC_xxx for each category (xxx can be MESSAGES, TIME, etc.).

LC_ALL overrides all settings. It's a way for applications to override all settings in order to work in a known locale (usually C, the default locale), typically so that various commands produce output in a known format.
So you can set LANG=de_AT.UTF-8 and LC_MESSAGES=C (C is the default locale and means untranslated; en_US is usually identical to C for messages).

However, there are two categories where I don't recommend changing the default, because it breaks a lot of programs:

LC_COLLATE is the character collation order. It's not very useful because it only indicates how to sort characters, not how to sort strings. Tools that know how to sort strings don't use LC_COLLATE. Furthermore a lot of tools expect things like “[a-z] matches all 26 ASCII lowercase letters and no other ASCII characters”, but that's not true in most non-default locales (try echo B | LC_COLLATE=en_US grep '[a-z]').

LC_NUMERIC indicates how to display numbers. In particular, in many languages, it makes floating point numbers use a , rather than . as the decimal point. But most programs that parse numbers expect a . and treat a , as a field separator.
So I recommend to

either explicitly LC_COLLATE=C LC_NUMERIC=_C,
or leave LANG unset and only set a value for the useful categories (LC_MESSAGES, LC_TIME, LC_PAPER, plus LC_CTYPE (whose value may vary depending on your terminal)).

See: http://docs.oracle.com/cd/E23824_01/html/E26033/glmbx.html

Actions

Also available in: Atom PDF