LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1190|回复: 10

如何才能仅把某个普通用户的默认locale设为中文而系统locale是英文

[复制链接]
发表于 2005-6-5 19:08:59 | 显示全部楼层 |阅读模式
1. 如何才能仅把某个普通用户的默认locale设为中文而系统locale是英文?
2. 为什么slackware10.1在我的美格570FS上显示出来对比度比较底,画面看上去比较灰暗?
发表于 2005-6-5 19:14:24 | 显示全部楼层
系统的locale默认就是C,在用户个人的登录shell配置文件如.bash_profile, .profile而不要在全局的/etc/profile.d/lang.sh设置locale就可以了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-5 20:32:37 | 显示全部楼层
是不是新建一个.bash_profile文件,把/etc/profile.d/lang.sh中的内容复制过去即可?
回复 支持 反对

使用道具 举报

发表于 2005-6-5 20:39:41 | 显示全部楼层
不是,只要在其中加入export LANG=zh_CN就可以了,系统默认locale是en_US而不是C。
回复 支持 反对

使用道具 举报

发表于 2005-6-5 21:07:05 | 显示全部楼层
系统默认locale是en_US而不是C。

不好意思,请问C是什么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-5 21:08:09 | 显示全部楼层
那我就不明白了。不用指定为zh_CN.gbk吗?
其次:
export LC_COLLATE=zh_CN.gbk
export LC_ALL=zh_CN.gbk
export G_BROKEN_FILENAMES=1
export XMODIFIERS="@im=fcitx"
这几句是干嘛的?最后一句应该不能少吧?
回复 支持 反对

使用道具 举报

发表于 2005-6-5 23:22:50 | 显示全部楼层
如果你只是想让用户的locale是zh_CN.GBK的话,
建立~/.profile或是~/.bash_profile,并加上export LANG=zh_CN.GBK就行了,其他的环境变量不需要变吧

to 万里北国:
C 在 lang.sh 里写有的
# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#export LANG=C
回复 支持 反对

使用道具 举报

发表于 2005-6-6 10:36:48 | 显示全部楼层
补充一点:

查看你终端的 local 用

$ locale

命令,然后根据显示出来的命令用 export 调整
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-6-6 13:20:55 | 显示全部楼层
Post by AMD-K6
补充一点:

查看你终端的 local 用

$ locale

命令,然后根据显示出来的命令用 export 调整

我的启动项是4,直接进X,没法用export调整。
就算可以,每次都export不是很不爽吗?
回复 支持 反对

使用道具 举报

发表于 2005-6-6 20:24:23 | 显示全部楼层
  1. # Since xdm doesn't run a bash -login shell (or any other login shell)
  2. # we should source these files to set up the user's environment.
  3. profile=/etc/profile
  4. userprofile=~/.profile

  5. if [ -r $profile ]; then
  6.         source $profile 1> /dev/null 2> /dev/null
  7. fi
  8. if [ -r $userprofile ]; then
  9.         source $userprofile 1> /dev/null 2> /dev/null
  10. fi
复制代码



所以添加在.profile也是有效的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表