QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2089|回复: 1

FC4中关于在字符界面下显示英文,在图形界面下显示中文的方法

[复制链接]
发表于 2006-7-11 19:28:31 | 显示全部楼层 |阅读模式
问题描述:如果我们在安装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"即可。

看了论坛中的很多文章,最没有这个方面的内容。也许是简单得大家都知道,不屑问和回答吧。我在这里写出来供大家参考,会者一笑,不会者学之,共勉!
发表于 2006-8-1 01:21:56 | 显示全部楼层
[code:1]      
       When bash is invoked as an interactive login shell, or as a  non-inter-

       active  shell with the --login option, it first reads and executes com-
       mands from the file /etc/profile, if that file exists.   After  reading
       that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
       in that order, and reads and executes commands from the first one  that
       exists  and  is  readable.  The --noprofile option may be used when the
       shell is started to inhibit this behavior.

       When a login shell exits, bash reads and  executes  commands  from  the
       file ~/.bash_logout, if it exists.

       When  an  interactive  shell that is not a login shell is started, bash
       reads and executes commands from ~/.bashrc, if that file exists.   This
       may  be inhibited by using the --norc option.  The --rcfile file option
       will force bash to read and  execute  commands  from  file  instead  of
       ~/.bashrc.

       When  bash  is  started  non-interactively,  to run a shell script, for
       example, it looks for the variable BASH_ENV in the environment, expands
       its  value if it appears there, and uses the expanded value as the name
       of a file to read and execute.  Bash behaves as if the  following  com-
       mand were executed:
              if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
       but the value of the PATH variable is not used to  search  for  the  file
       name.
[/code:1]

因此修改locale变量,应放在/etc/profile(所有用户)或~/.bash_login(单个用户真对bash)

如果放在.bashrc对konsole这样支持中文的程序也会有影响.
回复

使用道具 举报

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

本版积分规则

GMT+8, 2024-5-6 02:43 , Processed in 0.177507 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

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