LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices


By Burna at 2004-02-10 22:36

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

by penguin4 on Thu, 2004-06-24 16:08
Burna; what a neet article, especially since a bit of firmware,hardware and
other pc items being produced in asia. interpretation is vital. glad some one had foresight to go to asia and learn language . thank him! VITAL to all
of us that use any and all peripherals and firmware.


  



All times are GMT -5. The time now is 06:40 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration