FC4中关于在字符界面下显示英文,在图形界面下显示中文的方法
问题描述:如果我们在安装FC后,默认语言是中文的话,在图形界面下能够正常的显示中文,但是在字符界面下,所有的提示信息也是中文,但都成了方块,不能显示。看了一些文章,说是要装一个zhon软件,就可以看中文了。但有些人不愿意因为为了看一些提示信息就去装一个软件。那能不能让这些提示信息成为英文呢?也就是说在字符界面下系统语言是英文的。必竟用LINUX的人大部分对英文还是知道一点的。我的目的就是在字符界面下是英文系统,在图面界面下是中文系统。一些文章,讲如何让英文Linux系统显示和输入中文,方法是:修改/etc/sysconfig/i18n文件如下:
LANG="en_US.UTF-8"
SUPPORTED="zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN.UTF-8:zh:zh_TW.Big5:zh_TW:zh:en_US.UTF-8:en_US:en:ja_JP.eucJP:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
LC_CTYPE="zh_CN.UTF-8"
这样修改以后,在字符界面下是提示信息都成了英文。但是在图形界面下应用程序都成了英文界面,即使你安装了中文语言包并正确设置。比如说mozilla、OpenOffice、xmms等。
解决方法:不用修改i18n,只要在~/.bashrc中加入一句:LANG=en_US.UTF-8,如下:
# .bashrc
# User specific aliases and functions
LANG="en_US.UTF-8"
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
在i18n文件中的内容如下:
#i18n
LANG="zh_CN.UTF-8"
SYSFONT="latarcyrheb-sun16"
修改完后,存盘退出,重新启动X,你就会发现应用程序界面变成了中文。退出图形界面,在字符界面下,所有提示信息都成了英文,不会再有方块了!!!!!
也可以作如下修改:i18n文件内容如下:
LANG="en_US.UTF-8"
SUPPORTED="zh_HK.UTF-8:zh_HK:zh:zh_CN.GB18030:zh_CN.UTF-8:zh:zh_TW.Big5:zh_TW:zh:en_US.UTF-8:en_US:en:ja_JP.eucJP:ja_JP:ja"
SYSFONT="latarcyrheb-sun16"
LC_CTYPE="zh_CN.UTF-8"
然后修改/etc/X11/xinit/xinitrc.d/xinput.sh,在最后一行加入LANG="zh_CN.UTF-8"即可。
看了论坛中的很多文章,最没有这个方面的内容。也许是简单得大家都知道,不屑问和回答吧。我在这里写出来供大家参考,会者一笑,不会者学之,共勉!
When bash is invoked as an interactive login shell, or as anon-inter-
activeshell with the --login option, it first reads and executes com-
mands from the file /etc/profile, if that file exists. Afterreading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first onethat
existsandisreadable.The --noprofile option may be used when the
shell is started to inhibit this behavior.
When a login shell exits, bash reads andexecutescommandsfromthe
file ~/.bash_logout, if it exists.
Whenaninteractiveshell that is not a login shell is started, bash
reads and executes commands from ~/.bashrc, if that file exists. This
maybe inhibited by using the --norc option.The --rcfile file option
will force bash to read andexecutecommandsfromfileinsteadof
~/.bashrc.
Whenbashisstartednon-interactively,to run a shell script, for
example, it looks for the variable BASH_ENV in the environment, expands
itsvalue if it appears there, and uses the expanded value as the name
of a file to read and execute.Bash behaves as if thefollowingcom-
mand were executed:
if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
but the value of the PATH variable is not used tosearchforthefile
name.
因此修改locale变量,应放在/etc/profile(所有用户)或~/.bash_login(单个用户真对bash)
如果放在.bashrc对konsole这样支持中文的程序也会有影响.
页:
[1]