Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo中文化90%完美完成版-初段
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese)
View previous topic :: View next topic  
Author Message
kaytoo
n00b
n00b


Joined: 09 Dec 2006
Posts: 22

PostPosted: Mon Jan 22, 2007 3:54 pm    Post subject: gentoo中文化90%完美完成版-初段 Reply with quote

先用
Code:
locale
查看当前可以使用的字符集。缺少的添加
编辑
Code:
vi /etc/locale.gen

添加你想要的字符集,然后
Code:
locale-gen

OK,继续
以下文件如果不存在,请新建
Code:
vi /etc/env.d/100i18n

Code:

LANG=zh_CN.UTF-8
LC_CTYPE=zh_CN.gbk
LC_NUMERIC=en_US
LC_TIME=en_US
LC_COLLATE=en_US
LC_MONETARY=en_US
LC_MESSAGES=en_US
LC_PAPER=en_US
LC_NAME=en_US
LC_ADDRESS=en_US
LC_TELEPHONE=en_US
LC_MEASUREMENT=en_US
LC_IDENTIFICATION=en_US

Code:
env-update && source /etc/profile

安装字体
Code:
emerge zh-kcfonts arphicfonts twmoefonts fireflysung

然后开始美化
Code:
vi /etc/fonts/local.conf

取消在少於或等於 16 素像大小的中文字使用平滑 (anti-alias) 技術:
Code:

<!-- Disable font alias for Chinese <= 16px -->
  <match target="font">
    <test qual="any" name="family" compare="eq">
      <string>AR PL Mingti2L Big5</string>
      <string>AR PL SungtiL Big5</string>
      <string>AR PL New Sung</string>
      <string>Ming(ISO10646)</string>
      <string>MingLiu</string>
      <string>PMingLiu</string>
      <string>Kochi Mincho</string>
      <string>Baekmuk Dotum</string>
    </test>
    <test name="pixelsize" compare="less_eq">
      <double>16</double>
    </test>
    <edit name="antialias">
      <bool>false</bool>
    </edit>
    <edit name="hinting">
      <bool>true</bool>
    </edit>
  </match>

为字体排序
Code:

 <alias>
      <family>serif</family>
      <prefer>
         <family>Bitstream Vera Serif</family>
         <family>Times New Roman</family>
         <family>Times</family>
     <family>AR PL New Sung</family>
     <family>AR PL Mingti2L Big5</family>
     <family>AR PL SungtiL GB</family>
     <family>Ming(ISO10646)</family>
     <family>SimSun</family>
     <family>Kochi Mincho</family>
     <family>Baekmuk Batung</family>
      </prefer>
  </alias>
 <alias>
      <family>sans-serif</family>
      <prefer>
    <family>Bitstream Vera Sans</family>
     <family>Arial</family>
     <family>Verdana</family>
     <family>Helvetica</family>
     <family>AR PL New Sung</family>
     <family>Ming(ISO10646)</family>
     <family>AR PL kaitiM Big5</family>
     <family>AR PL kaitiM GB</family>
     <family>Kochi Gothic</family>
     <family>Baekmuk Dotum</family>
      </prefer>
  </alias>
<alias>
      <family>monospace</family>
      <prefer>
    <family>Bitstream Vera Sans Mono</family>
    <family>Courier New</family>
    <family>Courier</family>
    <family>AR PL New Sung</family>
    <family>Ming(ISO10646)</family>
    <family>Kochi Mincho</family>
    <family>Baekmuk Batung</family>
      </prefer>
  </alias>


接下来是安装输入法,最郁闷,最害怕,最讨厌,最头疼的时刻 = =;
Code:
emerge scim-pinyin

问题出现了,按照我以前的安装方法,结果却不能成功,不知道那里出错了.....我这里的症状是必须要手动输入scim -d才行,我继续研究,你继续实验 = =;我这是摘自网上的,在我这里行不通,不过到处有转贴,估计没有什么问题.
Code:
vi /etc/X11/xinit/xinitrc.d/32-scim
or
Code:
vi ~/.xinitrc

Code:

export XIM="scim"
export XIM_PROGRAM="scim"
export XIM_ARGS="-d"
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE="scim"
#export QT_IM_MODULE="scim"
scim -d


OK,90%完工.

PS:以上的信息全部都是来自互联网N位高手的精华,不过是俺组合组合整理整理.在这想给高人提个问题,现在的界面确实比以前清晰很多(按照我这套走,应该是英文的界面,但是可以显示中文,但是我发现使用gnome的类似bash的那个东东的时候,显示的字体不是很好看,我想要sans那种字体,试过修改/etc/fonts/local.conf文件把第一个选项都换成了sans,但是没有效果,照旧.不知道这个要怎么解决?)
Back to top
View user's profile Send private message
kaytoo
n00b
n00b


Joined: 09 Dec 2006
Posts: 22

PostPosted: Mon Jan 22, 2007 6:19 pm    Post subject: Reply with quote

大版主送我的东西我没有珍惜,罪过罪过 = =;
Quote:

set in ~/.xinitrc

#export LANG=zh_TW.UTF-8
#export LANGUAGE=zh_TW
#原文是没有注解掉上面这两行的,因为我要使用英文的界面,所以需要注解.
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"

exec dbus-launch --exit-with-session gnome-session
注意,以上的文檔是給 startx 指令用的, 如果是用圖型界面登入系統的,它是讀取這個文檔:
  ps: .xinitrc is used by console command "startx", for those who login system though GDM, here is one more step:

代码:
$ ln -sv ~/{.xinitrc,.xsession}


版主:我上面最后说的那个比较麻烦的要求能实现吗?想把gnome自带的那个文本界面的字体换一换,换成sans字体 :roll:
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Wed Jan 24, 2007 12:45 am    Post subject: Reply with quote

kaytoo wrote:
版主:我上面最后说的那个比较麻烦的要求能实现吗?想把gnome自带的那个文本界面(Gnome Terminal )的字体换一换,换成sans字体 :roll:


  可以通過兩個方法配置:

1 系統->偏好設定->字型( System->Peference->Fonts)

  Gnome Terminal 的程式主體字型採用的系統的 "固字寬度字型(Monospace)" 的設置,在這裏自訂喜愛的字型就可以。
  注意:此方法是全系統的配置,像Gedit 這樣的文本編輯器也會被以上的字型偏好設置而影響了。


2 Gnome Terminal->編輯->目前的設定組合->一般.自訂字型(GT->Edit->Current Peference->General.font...)

  Gnome Terminal 的程式主體字型是除了可以跟從系統的字型設置,也可以獨個設置,去掉 "指定系統的終端字型" 的勾,就可以自定了。



===簡化===========

Quote:

LANG=zh_CN.UTF-8
LC_CTYPE=zh_CN.gbk
LC_NUMERIC=en_US
LC_TIME=en_US
LC_COLLATE=en_US
LC_MONETARY=en_US
LC_MESSAGES=en_US
LC_PAPER=en_US
LC_NAME=en_US
LC_ADDRESS=en_US
LC_TELEPHONE=en_US
LC_MEASUREMENT=en_US
LC_IDENTIFICATION=en_US



如果只想要英文界面,只要設兩行就可以了:
Quote:

LANG=zh_CN.UTF-8
LC_MESSAGES=en_US


如果想要某國的所有國際化系統預設值(比如你住在美國),只要設以下兩行就行:
Quote:

LANG=en_US.UTF-8
LC_CTYPE=zh_CN.UTF-8


  以上兩組是有分別的,比如常用紙張的大小:第一組是 A4 ,而第二組的 Letter , 剩下的自行領會吧。:)
_________________
AKar
Back to top
View user's profile Send private message
unix_org
n00b
n00b


Joined: 08 Dec 2006
Posts: 2

PostPosted: Wed Jan 31, 2007 1:56 am    Post subject: Reply with quote

好贴,好贴,有了楼主的无私奉献,我等后生学习Gentoo就容易多了!
Back to top
View user's profile Send private message
flyght
n00b
n00b


Joined: 31 Aug 2006
Posts: 18

PostPosted: Tue Mar 27, 2007 1:58 pm    Post subject: Reply with quote

建议设置 LC_CTYPE=zh_CN.UTF-8,否则scim启动可能会有问题吧。
Back to top
View user's profile Send private message
kaytoo
n00b
n00b


Joined: 09 Dec 2006
Posts: 22

PostPosted: Sat May 05, 2007 2:36 am    Post subject: Reply with quote

这是现在的,用了大概有段时间,感觉良好
Code:
LANG="en_US.UTF-8"
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC=""
LC_TIME=""
LC_COLLATE=""
LC_MONETARY=""
LC_MESSAGES=""
LC_PAPER=""
LC_NAME=""
LC_ADDRESS=""
LC_TELEPHONE=""
LC_MEASUREMENT=""
LC_IDENTIFICATION=""
LC_ALL=""
:P
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 06, 2007 4:02 pm    Post subject: Reply with quote

请问谁知道如何在英文的Gentoo环境下显示中文文件名?

我的gentoo KDE可以正常显示和输入中文,美中不足的是无法显示中文文件名,都成了?号。我查阅了很多地方都没有找到合适的方案。
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 06, 2007 4:08 pm    Post subject: Reply with quote

Dear all, I am wandering how to display Chinese file name in a English Gentoo KDE.

I can display and input Chinese on my English Gentoo correctly, but the Chinese file names are all displayed as ????.
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Fri Jun 08, 2007 3:55 am    Post subject: Reply with quote

你可以先試一試:
Code:
LANG='zh_CN.UTF-8' ls


再看這篇的解釋: 中文環境桌面系統



修正 AKar@2007-06-09:12:44: 修正 用錯 tag,這次是 post 不是 topic。 @@
_________________
AKar


Last edited by akar on Sat Jun 09, 2007 4:45 am; edited 1 time in total
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Fri Jun 08, 2007 8:59 am    Post subject: Reply with quote

akar wrote:
你可以先試一試:
Code:
LANG='zh_CN.UTF-8' ls


再看這篇的解釋: 中文環境桌面系統


多谢akar指点!

我用
Code:
LANG='zh_CN.UTF-8' ls
这个方法看了一下移动硬盘上以前用ms-windows写的中文文件名仍然是问号。

我从gentoo用samba连接到另一台ms-windows上的共享文件夹上,可以看到中文文件名。反过来,在ms-windows上看gentoo的samba共享目录中的中文文件名也都是下划线。

我在genntoo里面可以自己建立中文文件名,可是复制到移动硬盘上之后拿到ms-windows上看到的是乱码。

你推荐的中文環境桌面系統链接已经失效了(?)
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Sat Jun 09, 2007 4:59 am    Post subject: Reply with quote

移动硬盘上之后拿到ms-windows上看到的是乱码
===========================================

  一般移動硬盤是 Fat16(12??), 掛接的時候可以添加這些參數: mount -t vfat -o iocharset=gb2312,code=cp936 ...
(繁體的中文編碼則是: cp950),相信就可以很好地解決這部份的亂碼問題。


samba中文文件名都是下划线
=========================

  samba本身有自己的關於文字編碼的設置參數:

版本2是:
Quote:
#client code page = 936


版本 3 有更完整的可設置參數:
Quote:
#預設值:
## dos charset = CP850 #簡體的,就都可以改為 cp936 ,而繁體則是: cp950
## unix charset = UTF-8
## display charset = LOCALE


  當然如果客戶端是 支援 Unicode 萬國碼編碼的話(例如沒有DOS),可以全設為 UTF-8。這樣存放上去 SAMBA的檔案名稱就可以其它國家的文字。


链接已经失效了(?)
====================

  不好意思,我又搞錯了, 英文的 post 和 topic 標簽,我一直搞不清。@@
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Mon Jun 18, 2007 3:22 pm    Post subject: Reply with quote

Quote:
多谢akar的回复。

我已经装过i18N,显示和输入中文没有问题,唯独问题在中文文件名。也曾经试过 mount -t vfat -o iocharset=gb2312,code=cp936 之类的各种组合,均无改进。

看到你写的
Zitat:
USE = USE+ "nls cjk unicode zh_TW" -- enable i18N
我猜想可能需要用你说的USE参数重新编译一下i18N。

AKar@2007-06-14 修改本帖編碼為 utf-8


Quote:
我在猜想會不會是 運行的程式和底層的文字編碼不一致而形成的給合性問題。可以找來一個目錄比較少資料、又有中文訊息的,然後用以下指令弄一些資料,然後貼上來看看:


$ LANG=C ls -1 |hexdump


AKar,不好意思,我前面回帖发到别处了,今天才在那边找到你的回答。

我在xp上把一个带中文的文件服制一个usb盘上,拿到gentoo上读,结果如下:
Code:

# ls
uboot10.rar  USB 2.0 ????.doc  win98j.ima  winimage.zip  xptovista.exe  YHfont

# LANG=C ls -1 |hexdump
0000000 6275 6f6f 3174 2e30 6172 0a72 5355 2042
0000010 2e32 2030 3f3f 3f3f 642e 636f 770a 6e69
0000020 3839 2e6a 6d69 0a61 6977 696e 616d 6567
0000030 7a2e 7069 780a 7470 766f 7369 6174 652e
0000040 6578 590a 6648 6e6f 0a74
000004a

上面USB 2.0 ????.doc的问号部分应该是中文。
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Wed Jun 20, 2007 1:01 am    Post subject: Reply with quote

Quote:

:
0000010 2e32 2030 3f3f 3f3f 642e 636f 770a 6e69
:


3f 對應的就是 那四個問號,而用 “LANG=C” 把 ls 指令臨時環境設成不轉作文字編碼轉換。所以,從以上的結果可以看出,這個移動硬盤的掛載時己是錯的了。

應再試試其它的文字編碼:
Quote:
# mount -o iocharset=gb2312,codepage=936


這次不要 "-t vfat",讓 mount 自動偵測(或者試試 -t msdos)。


最壞的情況下,如果充許的情況下,重新格式化一下這個移動硬盘。 但留意,如果這同時也是一台音樂播放機的話,格式化時就要用相同的文件系統(如果有的話,優先使用這播放機內置的格式化功能)


以下關於 FAT 文件系統的文檔:
http://zh.wikipedia.org/wiki/FAT
http://gentoo-wiki.com/HOWTO_Mount_MS_Windows_partitions_(FAT,NTFS)
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 20, 2007 8:50 am    Post subject: Reply with quote

多谢解答,mount -o iocharset=gb2312,codepage=936
无法挂载,显示:
Quote:
mount: wrong fs type, bad option, bad superblock on /dev/hda8,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

dmesg | tail
有这样的信息
Quote:
Unable to load NLS charset cp936
FAT: codepage cp936 not found

查了一下google,有人说是内核没有支持cp936。
我要再编译一下内核看看。
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 20, 2007 9:36 am    Post subject: Reply with quote

哈哈,终于搞定了。

重新编译内核,选定如下选项:
Quote:
File Systems --->
Native Language Support --->
--- Base native language support
<*>; Simplified Chinese charset (CP936, GB2312)
<*>; Traditional Chinese charset (Big5)

前者对简体中文支持,后者对繁体中文支持。

在按照Akar的方法挂载,就可以正常显示中文了。
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 20, 2007 9:44 am    Post subject: Reply with quote

前面一个帖子在gentoo-firefox写的,后面一个在xp写的。后者在xp下看到的是乱码,而在 gentoo-firefox看正常。

我在gentoo-firefox里面重贴一次:



Quote:
哈哈,终于搞定了。

重新编译内核,选定如下选项:
Quote:

File Systems --->
Native Language Support --->
--- Base native language support
<*> Simplified Chinese charset (CP936, GB2312)
<*> Traditional Chinese charset (Big5)

前者对简体中文支持,后者对繁体中文支持。

在按照Akar的方法挂载,就可以正常显示中文了。
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Wed Jun 20, 2007 11:22 am    Post subject: Reply with quote

又实验了一下
Code:
mount -o iocharset=gb2312
就可以了。
Code:
codepage=936
可以省略。
Back to top
View user's profile Send private message
akar
Bodhisattva
Bodhisattva


Joined: 03 Dec 2004
Posts: 348
Location: HKSAR,China

PostPosted: Mon Jun 25, 2007 6:52 am    Post subject: Reply with quote

Quote:
missing codepage or other error


解決了就好,不過之前你一直都不說這個報錯,還說可以掛載。是不是隐瞒病情?!! ^_^


對了,內核編譯對中文的支持,可以設為 可自動載入模組:
Quote:
File Systems --->
Native Language Support --->
--- Base native language support
<M> Simplified Chinese charset (CP936, GB2312)
<M> Traditional Chinese charset (Big5)


不妨把 UTF-8 支持也一併編了。
Back to top
View user's profile Send private message
ant1688
Tux's lil' helper
Tux's lil' helper


Joined: 03 May 2007
Posts: 138

PostPosted: Mon Jun 25, 2007 2:56 pm    Post subject: Reply with quote

多谢版主指教。

其实我以前也是用encoding-utf8进来才能看正常阅读的,可是auto-select似乎不能记住设置,每次都要重新选一次才能看(IE)。回帖的时候自动跑到gb2312了,所以每次输入都要版主帮忙转换。我现在输入这个utf-8的,希望能够直接成功。

Quote:

解決了就好,不過之前你一直都不說這個報錯,還說可以掛載。是不是隐瞒病情?!! ^_^

以前确实可以挂载,当然,是简单挂载,没有用到-o iocharset这个选项,结果都是问号。

而当时装了smaba,却可以看微软视窗上共享的中文文件名。看来smaba有自己的一套设置。
Back to top
View user's profile Send private message
young21
n00b
n00b


Joined: 25 Sep 2007
Posts: 3

PostPosted: Tue Sep 25, 2007 4:27 am    Post subject: Re: gentoo中文化90%完美完成版-初段 Reply with quote

真不错,正在尝试,感谢分享 :D
Back to top
View user's profile Send private message
Lance
Tux's lil' helper
Tux's lil' helper


Joined: 02 Apr 2004
Posts: 125

PostPosted: Wed Oct 24, 2007 3:26 am    Post subject: Reply with quote

不错,很有信息量。

akar很渊博啊
_________________
choose Gentoo, choose freedom
Back to top
View user's profile Send private message
ecctao
n00b
n00b


Joined: 17 Dec 2007
Posts: 2

PostPosted: Tue Dec 25, 2007 5:47 am    Post subject: Reply with quote

cant speak Chinese!

"Invalid Session. Please resubmit the form."
_________________
www.chipshow.com
led display|led screen
Back to top
View user's profile Send private message
xw_max
n00b
n00b


Joined: 25 Feb 2008
Posts: 4

PostPosted: Mon Feb 25, 2008 5:11 am    Post subject: Reply with quote

楼主讲的很细心啊,我玩Gentoo也有2年多了,不过完全投入是半年前换工作单位时候的事了,新工作单位网速超快,环境超宽松,工作环境就整个换成了Linux,现在感觉gentoo的portage真的是太神奇了啊。
我现在遇到了做程序的弟兄,都会向他们推荐Gentoo。
(本人刚从北京来到上海,继续程序员的生涯,呵呵)
Back to top
View user's profile Send private message
yuri-cn
n00b
n00b


Joined: 25 May 2007
Posts: 1

PostPosted: Wed Feb 27, 2008 1:14 am    Post subject: Reply with quote

上图是王道
Back to top
View user's profile Send private message
evolutiontofuture
n00b
n00b


Joined: 25 Mar 2008
Posts: 2

PostPosted: Tue Mar 25, 2008 5:59 am    Post subject: Reply with quote

输入法我喜欢用fcitx。
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index 中文 (Chinese) All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum