蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 | -->
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程 -->


    

蓝森林 http://www.lslnet.com 2006年8月16日 14:08


到底应该如何汉化呀!!

经过一番实验,发现下列问题
/usr/src/share/mklocale目录里面有很多.src
我给make ;make install
然后没有任何帮助~
发现如果setenv LANG=zh_CN.GB2312后
没有任何反应
但是当我做updatedb(跟linux里类似的,好像叫locate.updatedb,为了简化我把它alias成updatedb)之后会出现下列报错
perl:Warning: setting locale failed
perl:Warning:Please check that your locale settings:
LC_ALL="zh_CN.GB2312=",
LANG="zh_CN.GB2312="
are supported and installed on your system
perl:Warning:Falling back to the standard locale ("C")
即使我把上面那个东西make install完了也是这样
zh_CN.EUC和zh_CN.GBK都会出现这样的错误
然后我startx仍然都是"["
退出之后可以看到
Gdk-WARNING**:locale not supported by C Library
就是这样,我是使用的FreeBSD4.4Release的光盘安装的系统
没有安装XF86 3.3.6,直接安装的XF86 4.2.0,因为4.1.0对我的显卡支持的不太好,无法调到4.2.0所能达到的效果,所以装了这个,这回绝对不会漏掉东西,因为我装的时候还没有/usr/X11R6这个目录呢。请教二位大哥,像这样的错误,可能是怎么回事呢?
我现在怀疑是不是我不能够用setenv来设置LANG和LC_ALL?
你们觉得呢?可是我在profile里面加语句有没有任何反应!
请帮我找找原因好么,谢谢了。


Re: 到底应该如何汉化呀!!

FreeBSD的locale由三部分组成.
在/usr/share/locale里
注意系统缺省是不支持GBK的.
到zh_CN.EUC目录看一下,
LC_COLLATE指向一个通用的la_LN.ASCII/LC_COLLATE,是用colldef生成
源码在/usr/src/share/colldef目录
LC_TIME定义的是时间格式.使用frep生成,其实是一个文本文件.
源码在/usr/src/share/timedef
LC_CTYPE是最关键的,负责处理字符集.使用mklocale生成.
源码在/usr/src/share/mklocale/
所以GBK的locale可以使用zh_CN.EUC的LC_COLLATE和LC_TIME.
但必须扩充zh_CN.EUC的字符集
虽然zh_CN.EUC和gb2312是一样的.
但是系统并没有gb2312的locale(/usr/share/locale目录没有)
你不能设置为zh_CN.GB2312
可以自己在/usr/share/locale建一个联接的
但推荐使用GBK locale

出现locale not supported by C library是系统的原因.
与你的X无关.
所以首先你要保证你的系统locale是正确的.
同时你没有必要自己make make install啊.
安装完系统zh_CN.EUC的locale已经安装在系统了.



Re: 到底应该如何汉化呀!!

您能告诉我一下
关于环境变量设置的问题么?
为什么我用setenv就会有问题!
而在/etc/profile里面
加有没有反应呢?

Re: 到底应该如何汉化呀!!

我不会用csh
所以,我安装了bash
chsh -s /usr/local/bin/bash
然后退出重新登录.就可以使用bash了.
放心,不会有什么麻烦.
我一直都是这么用的.
然后你可以修改/etc/profile
加入
export LANG=zh_CN.EUC(你系统有的lcoale)
export LC_ALL=zh_CN.EUC
你也可以自己建立
~/.bash_profile
添加自己用户的内容.
同时,你也可以建立.bash_logout .bash_login
文件,指定相应的行为.
比如,我的bash_logout定义了
clear
每次exit就自动清屏


Re: 到底应该如何汉化呀!!

唉~
机器刚才一直开着
硬盘好像出了问题
要过一回才能在试了
不过我不太会用bash一直用csh
好像我修改/etc/profile
不起什么作用
启动了以后用
env
还是没有
不知是怎么回事

Re: 到底应该如何汉化呀!!

bash比csh简单多了.
我在linux下用惯了
实在不行可以登录之后在运行csh
环境变量可以保留的.


man csh

  建议你man csh,好好看看关于csh的FILE部分,这里列出了csh需要读取的脚本文件名,下面是我摘录的:


/etc/csh.cshrc Read first by every shell. ConvexOS,
Stellix and Intel use /etc/cshrc and NeXTs
use /etc/cshrc.std. A/UX, AMIX, Cray and
IRIX have no equivalent in csh(1), but
read this file in tcsh anyway. Solaris
2.x does not have it either, but tcsh
reads /etc/.cshrc. (+)
/etc/csh.login Read by login shells after /etc/csh.cshrc.
ConvexOS, Stellix and Intel use
/etc/login, NeXTs use /etc/login.std,
Solaris 2.x uses /etc/.login and A/UX,
AMIX, Cray and IRIX use /etc/cshrc.
~/.tcshrc (+) Read by every shell after /etc/csh.cshrc
or its equivalent.
~/.cshrc Read by every shell, if ~/.tcshrc doesn't
exist, after /etc/csh.cshrc or its equiva-
lent. This manual uses `~/.tcshrc' to
mean `~/.tcshrc or, if ~/.tcshrc is not
found, ~/.cshrc'.
~/.history Read by login shells after ~/.tcshrc if
savehist is set, but see also histfile.
~/.login Read by login shells after ~/.tcshrc or
~/.history. The shell may be compiled to
read ~/.login before instead of after
~/.tcshrc and ~/.history; see the version
shell variable.
~/.cshdirs (+) Read by login shells after ~/.login if

savedirs is set, but see also dirsfile.
/etc/csh.logout Read by login shells at logout. ConvexOS,
Stellix and Intel use /etc/logout and
NeXTs use /etc/logout.std. A/UX, AMIX,
Cray and IRIX have no equivalent in
csh(1), but read this file in tcsh anyway.
Solaris 2.x does not have it either, but
tcsh reads /etc/.logout. (+)
~/.logout Read by login shells at logout after
/etc/csh.logout or its equivalent.
/bin/sh Used to interpret shell scripts not start-
ing with a `#'.
/tmp/sh* Temporary file for `<<'.
/etc/passwd Source of home directories for `~name'
substitutions.

The order in which startup files are read may differ if
the shell was so compiled; see Startup and shutdown and
the version shell variable.



  如果读manual不方便的话,可以这样看:

  $ man csh | col | less

Re: man csh

setenv LANG zh_CN.(GBK,GB2312,EUC自己选择)
setenv LC_ALL zh_CN....
setenv XMODIFIERS @im=Chinput


Re: man csh

唉~
现在说什么也没有用了,我的硬盘死屁了
5555555555555555~
天哪!
最近怎么这么背!





Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com