SUSE9修改locale

SUSE9修改locale比较特殊,需要修改两个文件: /etc/sysconfig/language和/etc/SuSEconfig/profile
  vi /etc/sysconfig/language
RC_LANG="zh_CN.GBK"
ROOT_USES_LANG="yes"
vi /etc/SuSEconfig/profile
# start of i18n support
if test "$UID" = 0 ; then
    #
    # /etc/sysconfig/language: ROOT_USES_LANG = ctype:
    #
    # root uses only the LC_CTYPE. We unset all effective locale variables
    # but LC_CTYPE and set LANG to POSIX.
    # This is necessary for non iso-8859-1 roots to be able to type all
    # the characters in X Windows.
    #
    unset LANG
    unset LC_ALL
    unset LC_MESSAGES
    #LC_CTYPE="zh_CN.UTF-8"

    LC_CTYPE="zh_CN.GBK"
    export LC_CTYPE
    unset LC_COLLATE
    unset LC_TIME
    unset LC_NUMERIC
    unset LC_MONETARY
else
    #
    # All other users get all the locale variables from /etc/sysconfig/language:
    #
    #LANG="zh_CN.UTF-8"
     LANG="zh_CN.GBK"
    export LANG
    unset LC_ALL
    unset LC_MESSAGES
    unset LC_CTYPE
    unset LC_COLLATE
    unset LC_TIME
    unset LC_NUMERIC
    unset LC_MONETARY
fi
  
重启生效。可以用locale命令到普通用户下查看效果:
 LANG=zh_CN.GBK
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=

你可能感兴趣的:(职场,SuSE,locale,休闲,9)