+ -
当前位置:首页 → 问答吧 → 英文界面中文输入, 老调重*

英文界面中文输入, 老调重*

时间:2004-04-14

来源:互联网

懒得用中文写了, 将就着看吧. 我不喜欢用中文界面, 所以这里写的是如何
在英文界面的情况下输入中文, 参考了一些老贴子, 就不一一列举了.

我不喜欢用KDE和GNOME, 所以这里是给WindowMaker和其它Window Manager
用的. 而且我用的是miniChinput, 不过fcitx也是类似的.

This is a mini-HOWTO to setup Chinese input method for X Window
applications.


Result
. Start chinput Chinese Input Server in background automatically
after login X Window.
. Invoke chinput whenever one wants to input Chinese in mlterm,
mozilla and GTK2 applications by Ctrl_Space.
. Mozilla and GTK2 applicatioins start with English interface
only because Chinese interface is often buggy.


System
Slackware Linux -current (Apr 13, 2004) with glibc 2.3.2 and
xfree86 4.4


Software
Chinese Input Server: miniChinput 0.1.9, fcitx 2.0.1
Chinese Terminal: mlterm 2.8.0pl1
Window Manager: WindowMaker 0.82


Settings
. /usr/X11R6/lib/X11/fonts/TTF/
Copy simsun.ttc into this directory, then execute the following
commands
# cd /usr/X11R6/lib/X11/fonts/TTF/
# mkfontscale
# cp fonts.scale fonts.dir
# fc-cache

. /usr/local/lib/Chinput/Chinput.ad
Set some parameters as the following lines
chinput.gblocale = zh_CN.GB18030
chinput.font = 8x16
chinput.gbfont = -misc-simsun-*-*-*--*-*-*-*-*-*-gb18030.2000-0
chinput.gbkfont= -misc-simsun-*-*-*--*-*-*-*-*-*-gb18030.2000-0
chinput.gb18030font = -misc-simsun-*-*-*--*-*-*-*-*-*-gb18030.2000-0

. /etc/csh.cshrc and /etc/csh.login
Comment out the following line in these two files
setenv LC_ALL POSIX

. /etc/X11/xinit/xinitrc.wmaker
Add the following lines before starting WindowMaker
export LC_CTYPE=zh_CN
LC_ALL=zh_CN LANG=zh_CN /usr/local/bin/chinput &
If use fcitx, start fcitx as the following line
env LC_ALL=zh_CN LANG=zh_CN XIM=fcitx XIM_PROGRAM=fcitx XMODIFIERS=@im=fcitx fcitx &

. ~/.cshrc
Add the following lines
setenv LC_CTYPE zh_CN
unsetenv LC_ALL # make sure LC_ALL is not set
alias mlterm 'env LC_ALL=zh_CN LANG=zh_CN XMODIFIERS=@im=Chinput mlterm &'
alias bbs 'alias bbs 'env LC_ALL=zh_CN LANG=zh_CN XMODIFIERS=@im=Chinput mlterm -T BBS -e telnet http://www.mitbbs.com &'

. ~/.bashrc
Add the following lines
export LC_CTYPE=zh_CN
export LC_ALL= # make sure LC_ALL is not set
alias mlterm='LC_ALL=zh_CN LANG=zh_CN XMODIFIERS=@im=Chinput mlterm &'
alias bbs='LC_ALL=zh_CN LANG=zh_CN XMODIFIERS=@im=Chinput mlterm -T BBS -e telnet http://www.mitbbs.com &'

. ~/GNUstep/Defaults/WMRoot
Start Mozilla/mlterm/GTK2 applications as the following lines. In
fact, it may not be necessary to start Mozilla nd GTK2 applications
with LC_CTYPE=zh_CN because it's already setted in xinitrc.wmaker.
("Multilang Terminal", SHEXEC, "LC_ALL=zh_CN LANG=zh_CN XMODIFIERS=@im=Chinput mlterm"),
("Mozilla Browser", SHEXEC, "LC_CTYPE=zh_CN mozilla"),
(Gaim, SHEXEC, "LC_CTYPE=zh_CN gaim"),
("GNOME Terminal", SHEXEC, "LC_CTYPE=zh_CN gnome-terminal"),
...


Diagnosis:
Check ~/.xsession-errors for error messages or set the variables
manually to test the input method.

作者: terminator   发布时间: 2004-04-14