[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Default locale policy



Hi,

Here is my thought on locale set up after default installation should
be.  (This is with gdm 2.16.1-1)

Currently, default locale valure as installed on my system is:
  LANG="en_US.UTF-8"

This was selected not to get in troble with Japanese characters under
console.  That thought of UTF-8 itransition itself is good idea but it
is not simple.

I am wondering how best installer set up system.

Unless one is as expert as the installer team to set up console UTF-8
environment under non-X situation (i.e.,Linux console), you will likely
to get negative effect of screenfull of unreadable display if you are in
locale where characters not covered by ISO-8859-1 or similar.  This
happens in places such as Japan, China, Russia, Thailand(I am guessing),
...  (We do not set up UTF-8 framebuffer console as default by the
installer)

I think this is what we should expect under UTF-8 encoding:

Console and daemon should run under:
 --> For en_* and all non-latain character countrues:
       en_US.UTF-8
 --> For non-english latain character countries may choose:
       *.UTF-8 (Fr, De, It,...) but I think en_US.UTF-8 is OK too.

Then X applications should run under locale:
       *.UTF-8

I see 2 critical files:
  /etc/environment
  /etc/default/locale

The use is kind of mixed.

And: from my "grep pam_env /etc/pam.d/*":
| atd:auth           required pam_env.so
| cron:auth          required pam_env.so
| gdm:auth           required pam_env.so read_env=1
| gdm:auth           required pam_env.so read_env=1 envfile=/etc/default/locale
| gdm-autologin:auth required pam_env.so read_env=1
| gdm-autologin:auth required pam_env.so read_env=1 envfile=/etc/default/locale
| login:session      required pam_env.so readenv=1
| login:session      required pam_env.so readenv=1 envfile=/etc/default/locale
| ssh:auth           required pam_env.so # [1]
| ssh:auth           required pam_env.so envfile=/etc/default/locale
| su:session         required pam_env.so readenv=1
| su:session         required pam_env.so readenv=1 envfile=/etc/default/locale

I think changing as following will help:

| atd:auth           required pam_env.so
| cron:auth          required pam_env.so
| gdm:auth           required pam_env.so read_env=1
| gdm:auth           required pam_env.so read_env=1 envfile=/etc/default/locale
| gdm-autologin:auth required pam_env.so read_env=1
| gdm-autologin:auth required pam_env.so read_env=1 envfile=/etc/default/locale
| login:session      required pam_env.so readenv=1
| ssh:auth           required pam_env.so # [1]
| ssh:# auth           required pam_env.so envfile=/etc/default/locale
| su:session         required pam_env.so readenv=1


  /etc/environment      LANG=en_US.UTF-8
  /etc/default/locale   LANG=ja_JP.UTF-8

This way we use /etc/default/locale for GDM while others use default
/etc/environment.  (Thanks to recent bug #361090 fix which some people
oppose and reopened bug.)  

For French etc, maybe both /etc/default/locale and /etc/environment can
be fr_FR.UTF-8 too.

This way, we ensure GDM talks the local language while X is run under
ones preffered locale set by GDM.  At the same time, console, ssh and su
are run under barebone so vt-100 terminal will not be surprized by
Japanese characters.  (SSH may bebetter to leave commented out line.)

I do not care the use of these 2 files are swapped as long as gdm is
started under *.utf-8 while console stays under en_US.utf-8.

Osamu



Reply to: