ugroh@t-online.de (Ulrich Groh) さんは書きました:
Mike, in one of your answers to the "Encoding" problem of Ludger you wrote:
" .... I run my computers in ja_JP.UTF-8 locale, it nice to be able to view Files containing Japanese and German Umlauts simply with less in a terminal like mlterm or xiterm and have everything display correctly. ... "
Can you tell me where to set this? It would help me too, e.g. writing mails to Japan would make live easier.
If you want to do it differently for each user, you can edit the login
profile in the users home directory. For example you can add something
like the following to ~/.profile:
export LANG=de_DE.UTF-8
export LC_MESSAGES=en_GB.UTF-8
export LC_CTYPE=ja_JP.UTF-8
You don't need to set all LC_* variables, those which are unset
inherit their value from LANG. If you want one locale for
everything, it is usually enough to set only LANG.
You can set the different LC_* variables to different values to
mix features of different locales.
In the above example, LC_CTYPE=ja_JP.UTF-8 sets the character handling
to UTF-8 *and* enables Japanese input via XIM, for example with
kinput2/Canna. Setting LC_CTYPE=de_DE.UTF-8 would also enable you to
display Japanese and German, but it would disable Japanese input.
LC_MESSAGES=en_GB.UTF-8 makes error messages etc. be displayed in
English. LANG=de_DE.UTF-8 then indicates that all the rest of the LC_*
variables which are still unset should use de_DE.UTF-8 as the default.
With the above settings, the 'locale' command should output:
mfabian@magellan:~$ export LANG=de_DE.UTF-8
mfabian@magellan:~$ export LC_MESSAGES=en_GB.UTF-8
mfabian@magellan:~$ export LC_CTYPE=ja_JP.UTF-8
mfabian@magellan:~$ locale
LANG=de_DE.UTF-8
LC_CTYPE=ja_JP.UTF-8
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE=POSIX
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES=en_GB.UTF-8
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
mfabian@magellan:~$
the values of LC_* variables within double qoutes are inherited from
LANG.
You can also set systemwide default values for the locale settings in
/etc/sysconfig/language. RC_LANG is the varlable initializing LANG,
RC_LC_CTYPE is the intial value of LC_CTYPE etc...
I use the following settings in /etc/sysconfig/language and have
no locale specific settings in the profiles in my home directory:
mfabian@magellan:~$ grep -v "#" /etc/sysconfig/language
RC_LANG="ja_JP.UTF-8"
RC_LC_ALL=""
RC_LC_MESSAGES=""
RC_LC_CTYPE=""
RC_LC_COLLATE="POSIX"
RC_LC_TIME=""
RC_LC_NUMERIC=""
RC_LC_MONETARY=""
ROOT_USES_LANG="yes"
mfabian@magellan:~$
I set ROOT_USES_LANG="yes" because I want ja_JP.UTF-8 locale by
default even for the root account on my machine.
--
Mike Fabian