Linux FAQ's & Manuals


system defaults and user settings

the system wide default values for the locale specific environment variables can be set in the file /etc/sysconfig/language. this file contains variables with the rc_ prefix added to the names of the locale specific environment variables and one additional variable root_uses_lang which can be set to ``yes'', ``no'' or ``ctype''. ``yes'' means the root user gets the same locale settings by default as any other user, ``no'' means the root user will use the posix locale only, ``ctype'' means the root user will get the same effective default value for lc_ctype as other users but use posix for all other language specific environment variables.

for example if you want to make japanese with utf-8 encoding the system wide default for all locale categories and want to use the same default for the root account, you can put

     rc_lang="ja_jp.utf-8"     rc_lc_all=""     rc_lc_messages=""     rc_lc_ctype=""     rc_lc_collate=""     rc_lc_time=""     rc_lc_numeric=""     rc_lc_monetary=""     root_uses_lang="yes" 

into /etc/sysconfig/language.

after editing that file, call suseconfig --module profiles and login again.

suseconfig --module profiles makes the default system profiles use locale settings according to the settings in /etc/sysconfig/language by generating /etc/suseconfig/profile, /etc/suseconfig/csh.cshrc, and /etc/suseconfig/csh.login which are sourced from /etc/profile, /etc/csh.cshrc, and /etc/csh.login respectively.

one can also use the yast2 sysconfig editor to change the values of the variables in /etc/sysconfig/language instead of editing the file directly with a text editor. yast2 has also a module to select the ``system language'' but currently this sets only rc_lang in /etc/sysconfig/language, i.e. if you want to set other locale specific environment variables yoo need the yast2 sysconfig editor or a text editor. yast2 will automatically call suseconfig wenn finished.

if you don't want to change the default locale settings for the system but only for a specific user, you can put the the settings in to the profiles in that users home directory.

for example, bash users can put

     export lang=ja_jp.utf-8     export lc_messages=en_gb.utf-8 

into ~/.profile for tcsh users the same can be achieved by putting

     setenv lang ja_jp.utf-8     setenv lc_messages en_gb.utf-8 

into ~/.login.

2005-03-09