分类: LINUX
2009-03-23 11:13:15
设置前,使用默认locale:
[root@db-wanggaofei ~]# locale
LANG="POSIX"
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
设置后,使用zh_CN.GDK中文locale:
[root@db-wanggaofei ~]# export LC_ALL=zh_CN.GBK
[root@db-wanggaofei ~]# locale
LANG=zh_CN.UTF-8
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=zh_CN.GBK
· # This file lists locales that you wish to have built. You can find a list
· # of valid supported locales at /usr/share/i18n/SUPPORTED. Other
· # combinations are possible, but may not be well tested. If you change
· # this file, you need to rerun locale-gen.
· #
·zh_CN.GBK GBK
·zh_CN.UTF-8 UTF-8
-----------------------------------------
在我看来只要搞清楚LANG和SUPPORTED就OK了,其他可能平时也用不太多。再参考篇文章,如下,是讲如何设置环境变量的。
-------------------------------------------
修改 /etc/sysconfig/i18n 文件,如
LANG="en_US.UTF-8",xwindow会显示英文界面,
LANG="zh_CN.GB18030",xwindow会显示中文界面。
还有一种方法 cp /etc/sysconfig/i18n $HOME/.i18n
修改 $HOME/.i18n 文件,如
LANG="en_US.UTF-8",xwindow会显示英文界面,
LANG="zh_CN.GB18030",xwindow会显示中文界面。
这样就可以改变个人的界面语言,而不影响别的用户
修改后的/etc/sysconfig/i18n 文件为:
LANG="en_US.UTF-8"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
LC_ALL="en_US.UTF-8"
export LC_ALL
设置完毕后重启或者用rc.local使生效