LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: hunanese

请问scim的问题!

[复制链接]
发表于 2004-10-17 21:03:52 | 显示全部楼层
linuxquestions上面的一篇解决办法希望有用

Mandrake-Linux and Chinese


Author: Gerrit Fricke
English translation : Rombout Gaster

last update 01.16.2004

This manual is ment for all who would like to be able to write Chinese with Linux with a German (works with other languages as well, just change the iso-locale de_DE to your prefered language) desktop, without having to chance the locale. The distribution I use is Linux Mandrake 9.1 with KDE 3.1.4 (but is supposed to work with at least all Mandrake 9.xx editions: as for other distributions, well just give it a try).

contents:


1. Mandrake installation: install the locales
2. the Chinese IME (Input Manager Editor): SCIM
2.1 how to install SCIM (Smart Common Input Method)
3. modify the configuration files
3.1 /etc/sysconfig/i18n
3.2 /home/user/.i18n
4. change the menu font
4.1 KDE
4.2 GTK2 (Gnome2)
4.3 GTK1 (Gnome1)
5. notes on OpenOffice.org


1. Mandrake installation: install the locales

When installing Mandrake please make sure you install all language environments you would like to use. When prompted, make sure at least you also choose simplified Chinese. If you don't, and you try to install the locale from the installation CD afterwards, the language files of Gnome applications will not be installed automatically and you will have all Gnome applications with the original English settings. So for German and simplified Chinese, with the installation of Mandrake Linux I installed locales-D (for German) and locales-zh_CN (for simplified Chinese). Furthermore you will have to install the fonts ttf-gb2312 and ttf-big5 as well as kde-i18-zh, the simplified Chinese language pack for the KDE-Desktop, in case you would like to have your desktop in simplified Chinese and the kde-i18-de for a German desktop.


2. the Chinese IME: SCIM

At this point using LocaleDrake you are able to switch the language environment; just chance to simplified Chinese and ...there you are, KDE shows itself in a completely Chinese Desktop environment. Now that looks nice, but how do I write Chinese? The Mandrake installation CD's with Chinput and XCIN. Chinput however does not seem to function properly with Mandrake 9.1 (at least not the version on the installation CD) and XCIN, well it's just not my kinda thing. So what's next?


2.1 install SCIM (Smart Common Input Method)

I simply downloaded turbolinux's SCIM. The default Pakackages work perfectly, even when you may stumble upon dependency problems with GTK2 while installing. So fire up Konqueror, change into the directory where you downloaded the rpm-packages, click on tools and open a terminal and put in the following:

"su" and press ENTER

you will then have to fill in your root's password

then type "rpmi --install --nodeps paketname.rpm"

You will have to download and install the following SCIM packages: scim-0.8.2-1.i586.rpm and scim-chinese-0.2.6-1.i586.rpm (for pinyin input method). These at least are the actual versions at the time this manual was written (11/2003)

Now you will have to modify the file /etc/X11/xinit/XIM (as root). This file tells your locale which IME to use and to start automatically when logging in as user. If you want to use SCIM make sure the file contains the following under and delete everything that was listed there previously
zh_CN*) # Simplified Chinese

if type -p scim > /dev/null 2>&1 ; then
export XMODIFIERS="@im=SCIM"
scim -d
elif type -p xcin > /dev/null 2>&1 ; then
export XMODIFIERS="@im=xcin-zh_CN" LANG=zh_CN LC_ALL=zh_CN xcin &
fi
;;

save the file and you are ready to go.

Then, using LocaleDrake change to simplified Chinese as the language to use and start KDE again. Now you can start typing Chinese by just pressing the CTRL and SPACE button simultanously.


3. modify your configuration files

3.1 /etc/sysconfig/i18n

This file contains the language instructions for your computer system to use while booting. We will have to append at least the UTF-8 extensions to the ISO annotations of the locales (e.g. for English en_US.UTF-8). As I want my System to work completely in German, my file looks like this:

LC_TELEPHONE=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LANGUAGE=de_DE.UTF-8:de
LC_MONETARY=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
SYSFONT=lat0-16
LC_TIME=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LANG=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8

LC_IDENTIFICATION=de_DE.UTF-8


3.2 /home/user/.i18n

Unfortunately all IME's I know only function when the locale has been set, that is in our case with Chinese as language for our System. However, many people would just like to have a German Desktop while still being able to write Chinese. To achieve this open the .i18n file in your /home/nameofuser directory (note the dot infront of the file name, this means it's a hidden file, so adjust your Konqueror to show hidden files). In case you do not have sucha file, then make a new file and save it with this name. This file will substitute the annotations in the /etc/sysconfig/i18n file for this particular user only. Open the file in an editor (e.g. Kwrite), for your Chinese user account the contents will somewhat look like this:

LANGUAGE=zh_CN.GB2312:zh_CN:zh
LC_ADDRESS=zh_CN.UTF-8
LC_COLLATE=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
XIM=chinput
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8

LC_MEASUREMENT=zh_CN.UTF-8
LANG=zh_CN.UTF-8
LC_MESSAGES=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
CONSOLE_NOT_LOCALIZED=yes
LC_MONETARY=zh_CN.UTF-8
XIM_PROGRAM=chinput
LC_PAPER=zh_CN.UTF-8
XMODIFIERS="@im=chinput"

Change the contents with Kwrite, so that it looks like this:

LANGUAGE=de_DE:de_DE.UTF-8:de
LC_ADDRESS=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
XIM=scim
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LANG=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_TELEPHONE=de_DE.UTF-8
CONSOLE_NOT_LOCALIZED=yes
LC_MONETARY=de_DE.UTF-8
XIM_PROGRAM=scim
LC_PAPER=de_DE.UTF-8
XMODIFIERS="@im=scim"


4. Change the menu font
4.1 KDE

Now finally we've got KDE running in German and SCIM works flawlessly. But those fonts are a disaster! Dive into the KDE-Control Center and change it to your favorite font, in my case Helvetica or Arial. Now the KDE applications suddenly look much better.


4.2 GTK2 (Gnome2)

But what about GTK2 applications? Apparently they still use AR PL SungtiL GB as font. That may be ok for Chinese, but look terrible with the Latin alphabet. Make a file called .gtkrc-2.0 and save it to your /home/nameofuser directory. This is the content of the file:
gtk-font-name="fontofyourchoice 10"

For fontofyourchoice you may choose Arial, or Helvetica or wahtever you prefer, i.s.o. 10 you may fill in a different size, optimated for you. Save the file.


4.3 GTK1 (Gnome1)

GTK1-applications thereafter still look bad. You may change that by opening the file /etc/gtk/gtkrc.iso-8859-15 (again, as root) and save it as /etc/gtk/gtkrc.zh_CN.UTF-8. Before that make sure you saved the original /etc/gtk/gtkrc.zh_CN.UTF-8 file under a different name, e.g. gtkrc.zh_CN.utf8--original. You never know, maybe someday you would like to have a completely Chinese desktop after all... OK, now GIMP 1.2 or GRIP also have a nice Helvetica as font. By going into the newly created gtkrc.zh_CN.UTF-8 you can at all times change the font.

Now, eveything should be set: a German Desktop, Chinese IME and fonts you can live with.


5. Notes on Openoffice.org

One remark on OpenOffice. As this office suite does not support OnTheSpot-Mode, you will have to disable this function within SCIM setup under Frontend->X Window. While you're at it, also disable show status box. Also make sure you update to OpenOffice 1.1, as CJK support has finally been implemented decently. Now you still have top configure everything at tools->options->language. For mixed documents, for language set German i.s.o. default (or standard). Set like this you are able to use different fonts for German or Chinese, provided you have configured that at tools->options->textdocument->basic fonts (western, asian). As a rule you have to use AR PL KaitiM GB or AR PL SungtiL GB for simplified Chinese. In case you have installed Windows fonts, you may also use SimSun or SimHei.

have fun toggling Chinese!

In case you have any questions or if you find a bug, please contact me. You may use the manual at your own risk. The author does is not liable for any damages caused.

Gerrit Fricke Beijing, 11.05.2003

This manual has been published under the BSD license, in case you pass it on, please always mention the name of the author
发表于 2004-10-18 01:42:33 | 显示全部楼层
it's quite different from mine.i can not find /etc/sysconfig/i18n,/etc/X11/xinit/XIM in my system,
my locale is zh_CN.gbk,
发表于 2004-10-18 01:45:54 | 显示全部楼层
i boot in a x mod,not text mod,need i config my ~/.bashrc?
may i just config it in /etc/X11/xinit/xinitrc?
发表于 2004-10-18 10:00:01 | 显示全部楼层
I use Debian and KDE, and my locale is:

Debian:~# locale
LANG=zh_CN.GBK
LC_CTYPE="zh_CN.GBK"
LC_NUMERIC="zh_CN.GBK"
LC_TIME="zh_CN.GBK"
LC_COLLATE="zh_CN.GBK"
LC_MONETARY="zh_CN.GBK"
LC_MESSAGES="zh_CN.GBK"
LC_PAPER="zh_CN.GBK"
LC_NAME="zh_CN.GBK"
LC_ADDRESS="zh_CN.GBK"
LC_TELEPHONE="zh_CN.GBK"
LC_MEASUREMENT="zh_CN.GBK"
LC_IDENTIFICATION="zh_CN.GBK"
LC_ALL=zh_CN.GBK

Are there any problems? And what should I do then?
发表于 2004-10-19 03:30:13 | 显示全部楼层
it's quite different from mine.i can not find /etc/sysconfig/i18n,/etc/X11/xinit/XIM in my system,

我也是
我觉的很多人都是没有配置/etc/X11/xinit/xinitrc.d/xinput的原因吧?
反正我配配那文件就行了 也不用搞那么多的事
我装的是1.0.1
用的很好 :p
发表于 2004-10-19 18:57:13 | 显示全部楼层
相反我就是没有配置xinput,因为无论我怎么按论坛里的方法配置都始终不能调出输入法(虽然输入法已经启动了),最后干脆什么都还原了,只在启动时加上启动scim,一切搞定了(除了还有人反映的在浏览FLASH网页时关闭浏览器出错的问题),我用FC2+KERNEL2.6.6+GONME2.6
发表于 2004-10-19 21:54:06 | 显示全部楼层
最初由 blackpenguin 发表
it's quite different from mine.i can not find /etc/sysconfig/i18n,/etc/X11/xinit/XIM in my system,

我也是
我觉的很多人都是没有配置/etc/X11/xinit/xinitrc.d/xinput的原因吧?
反正我配配那文件就行了 也不用搞那么多的事
我装的是1.0.1
用的很好 :p
say you setup xinput
发表于 2005-2-21 21:05:55 | 显示全部楼层
I have the same problem.But I can't solve it.
回复 支持 反对

使用道具 举报

发表于 2005-2-22 22:12:21 | 显示全部楼层
晕!
我的也是。
查了好多帖子,总算明白了一点,scim在k程序里好像是不能用的,需要装上qtimm和skim才行啊
回复 支持 反对

使用道具 举报

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

本版积分规则

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