LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   contemplations on Linux and Chinese wordprocessing (https://www.linuxquestions.org/questions/linux-newbie-8/contemplations-on-linux-and-chinese-wordprocessing-124369/)

fiets 12-09-2003 06:16 PM

contemplations on Linux and Chinese wordprocessing
 
I've been reading lots of stuff for the last few weeks to find out how I might be able to use Linux to read and write Chinese. I've installed and played around with a red hat and a knoppix distribution, finding the latter much easier to maintain and install, at least in the basic installation but I did not get much beyond that sofar.

My basic requirements of a Linux distribution would not go much more beyond the mere fact that I would like to be able to read (which I can in a browser) and write Chinese (which I can't) within an English or other western desktop environment. Not being a programmer, I do not see why I would require different editors to be able to process Chinese, nor am I a gamer, so I do not need any emulators to be able to process Chinese.
Maybe I misunderstand the concept of Linux but I would only like to be able to write Chinese in OO Office in an email program and in a browser (comparable to writing Chinese with e.g. twinbridge or mview in windows).

The Chinese Howto (which seems outdated to me but being still ignorant on the subject I may be wrong) does not give answers to basic questions that arise from deep within me:

A
even if I manage to install everything as described in the Chinese Howto, how would I be able to input Chinese, how would it work? Do I get a virtual keyboard that supplies me with possibilities to write pinyin and then have a selection of Chinese characters as in Twinbridge and the like? I do not really see how this can be performed by only loading Chinese fonts.
Why would I need Xcin or Latex to write Chinese in OO Office, in a browser or email program?

B
Eventually, after hopefully having received some answers on my questions in A, I would like to know if there are any particular "Western" distributions that are "better suited" to be able to write Chinese in applications as described above. In particular: does anybody have any experiences with knoppix 3.2 and Chinese?

C
Suppose I install a Chinese distribution: does Red Flag 4.0 (Chinese version) provide the possibility to "localise" in a western environment, that is, I run it as an English or Dutch environment and just use the Chinese functions to read and write Chinese?

I would be grateful for any comments, remarks and answers before I drown my self into the sea of Linux....

wapcaplet 12-09-2003 07:12 PM

I do not have any answers for you, but I just coincidentally noticed a review of StarOffice 7 which mentions that Asian language support is one of the new features.

JDW 12-09-2003 08:29 PM

contemplations on Linux and Chinese wordprocessing
 
Hi Fiets,

There are many threads/posts that will solve these questions for you, just type "chinese input" or something similar e.g. "xcin", "chinput", "fcitx", "chinese locale" etc.) in the search field of the forum page of this website (which is a great site for newish Linux users!), and spend some time reading through what other people have found out about this topic.

Basically, though, I use Mandrake 9.2 (but have also installed Redhat 9) with an English environment and I have pretty much full functionality using Chinese input methods such as Chinput and fcitx. xcin is superb for Traditional Chinese input as well. xcin and chinput will usually be included with any major distro, fcitx can be found on the Net (www.fcitx.org).

The fundamental way this works in Linux is that in order to read & type in Chinese characters, you need to create a separate Chinese user (e.g. "simpuser") which will have its own home directory at /home/simpuser. You add the following lines to the .bashrc file in this directory IN ORDER TO CONVERT THIS USER TO CHINESE LOCALE SETTING:

export LANG=zh_CN // or zh_TW.Big5 for traditional locale
export LC_ALL=zh_CN
export LC_CTYPE=zh_CN
export XMODIFIERS=@im=chinput // or xcin or fcitx or scim etc.

after logging in to this new user, type locale at the command line and it will indicate that these changes have been implemented.


Remembering that Linux (and Unix!!) is a true multi-user system, so while I am logged in as my main English user-name, I can log into my Chinese user at the same time (I log in through the command line in Konsole), and any application that is started from this separate user environment will have the locale set to Chinese. To start an app :

simpuser@localhost$ chinput & oowriter // this will start the chinput input server and then start up Open Office Writer, which should have Chinese menus etc. Type CTRL+SPACE and the input window should be there.

I have tested chinput & fcitx with lots of apps, I would mostly use oowriter & kmail, but I have got this working fine with Evolution, Mozill Mail, Kword etc.

Good tip : for pinyin input, fcitx is pretty cool and seems to work with every application that I have tried it with, including oodraw. also, if you need an xterm-like app with Chinese capability, download cxterm...it is very easy to use...

You said that the Chinese how-to is out of date - couldn't agree more! i am only a simple user and not a developer, but I think a few of us could get together and write an up-to-date How-To for Chinese from an end- user's perspective, that would take into account quirks and differences between distros etc. Just a thought...

cheers,

jdw

fiets 12-10-2003 06:02 PM

Howdy JDW,

We're getting somewhere, thanks to you. Not that I'm quite sure where this will all lead to but I wet my feet already so I guess there's no turning back.

What I was really looking for was some kind of an answer as to how the system functions compared to twinbridge and the like in windows. I found some pics which make me feel more comfortable as I recognise the stuff ;-). I still do not see yet why I wld need all kinds of editors like xcin and xcitx but I'll worry about that later.

As my Knoppix distribution does not have any Chinese fonts by default, I guess I'll have to start to download some fonts. And even as I'll add a user for Chinese usage, I'll install the fonts as root as I might add more than one user to write Chinese eventually.

As for the xcin and xcitx: assuming they were not included in the mandrake distro you use either: did you install them at root level or at user level?

This will do for the time being, I guess I'll be busy with this for a while.

I would not mind participating in making a new how to (for newbies) eventually but I suppose I would need an expert to comment on anything I write eventually as I still do not really know what I'm talking about here, if you know what I mean.....

JDW 12-10-2003 06:34 PM

contemplations on Linux and Chinese wordprocessing
 
Hi,

xcin, chinput and fcitx are not actually editors, they are XIM input servers that allow you to in multi-byte characters such as simplified & traditional Chinese.

I had a look at the Gentoo Chinese Localisation guide, that is a pretty darn good how-to! The only thing is that some of the commands given may be Gentoo-specific (?), rather than being usable for other distros. Thanks for that though...

JDW

Maurice Arthur 12-26-2003 01:12 AM

Have down loaded fcitx but tar zxvf fcitx -1.8.5 .tar.gz does not work
Maurice

Maurice Arthur 12-27-2003 03:21 AM

fcitx
 
Downloaded fcitx
Installed to step 4
Unable to find ~/.bashrc in /home/simpuser
Added Windows fonts but Pinyin fonts do not show up in linux.
Cd /usr/bin 1n -sf fcitx chinput Not found
Have reached sofar but unable to print LinuxSir.org page in Chinese the fonts are not installed
Any help appreciated
Maurice

fiets 01-04-2004 07:42 PM

Had to take a few days off, xmas and stuff, so first of all happy new year...

for Maurice:
Quote:

Unable to find ~/.bashrc in /home/simpuser
open up your console and type ls -a and you'll find the hidden files: .bashrc should be listed.
Now open up an editor e.g. emacs by typing "emacs .bashrc" in the console and you can modify the .bashrc file.

For the rest, it's completely as JDW mentioned.


As for me, I installed mandrake 9.2 as recommended by JDW. Mandrake 9.2 comes included with xcin and chinput. I was pleasantly surprised, as it saved me the hassle of getting these programms running.First I thought I could just as easily run a Chinese locale by adding a user with a Chinese layout but this did not work as both the user I added for Big5 and for GB missed essential characters in the GUI. Then I did as indicated by JDW.
So JDW, this was a pretty good description, but I won't let you off this easily: what you described here was not mentioned in any HOWTO or description I've found so far: where did you find it?

Obviously this still leaves me with more questions:

1 The Chinese GB characters displayed in the GUI seem rather small, this is hard to read: where does one change the settings?
2 OOwriter gives me the choice of using only one 2 GB fonts: either KaitiM or SungTiL. So far I've only tried the whole thing out with oowriter: are there
other GB fonts installed on the system that aren't listed for this particular application or should they be installed manually after wards?
3 Can one set the locale for both GB and BIG5 for one user or should they be set for different users? I mean suppose I want to create a text with both GB and BIG5? How do you do that?
4 On the other hand can one set the locale for more than one XIM input servers, e.g both xcin and chinput?
5 Can one use the input serve (xcin, chinput) with 2 different applications like oowriter and kmail at the same time? I've not been able to find this out so far.
6 I've no experience so far with any xterm application: what do you use cxterm for?

This will do for now, right now I'm glad I've been able to find a way to type Chinese in Linux for the very first time and have the opportunity to write
Chinese in one and the same document with German, which is something I've never materialized in Windows ;-).

JDW 01-04-2004 09:04 PM

contemplations on Linux and Chinese wordprocessing
 
Hi,

Thanks for the compliments, I actually wrote this stuff out at work (during lunch time of course;-), I didn't actually get these instructions from any one particular place, but through trial and error and a lot of reading of user groups (i've noticed Linux/Unix is like that!) I have sort of worked it out (albeit slowly & bit by bit) on my own.

You have many questions, I will try to answer them as best I can, remember I am still very "newbie" in a lot of areas, so here goes :-

1) Chinese characters to small in the input window - there must be a line that can fix this somewhere in the config file (in /etc somewhere?) - i'm just not really sure

2) You only get 2 fonts with the distro, but you can look around on the Net for many good ones

3) GB / Big5 should have their own users...you can still launch apps with them simultaneously...

4) & 5) Not that I'm aware of/not that I've tried - I will check tonight

6) cxterm is just an editor that is Chinese-enabled that is a terminal window app (i.e. without GUI stuff)

good to hear that you've had some success getting Chinese input happening in Linux...

JDW

Maurice Arthur 01-05-2004 02:11 AM

Chinese fonts
 
Many thanks for reply and Wish you well for 2004
JDW has added further comments.
Will attempt adding the fonts that I have when I recover from system error
can boot up and type startx but startx just pops up a text eror screen regarding XF86 Config-4 etc
So no mandrake 9.1 as yet on line
A good linux new year for me.
Keep on learning linux I might be able to use VIM
Regards
Maurice

Jiawen 01-06-2004 02:08 PM

On the topic of Chinese fonts, I found Alastair Tse's Chinese Fonts page extremely useful. Basically what it comes down to is, there aren't very many freely available Chinese fonts that work with Linux. I'm still trying to get the fonts I bought here in Taiwan to work. :(

Also check out Tse's excelent Chinese input howto. Although it's written for Gentoo, a lot of what he says is applicable to other distributions. He has good reviews of the different input systems and descriptions of how to get them running.

Finally, about cxterm and RXvt and other terminals: they're mostly useful for doing system modifications and maintenance, though you rarely need Chinese input for that. One thing they are very useful for, though, is getting onto Chinese BBS systems. For example, there's a huge and thriving Linux community on a local Taiwanese BBS, KKCity. I use RXvt to get there. I have a mini-howto for doing this with telnet and RXvt; does anyone here know how to do it under ssh?

fiets 01-07-2004 02:55 PM

JDW,

As for my previous questions:
1
well, what I actually meant was that the font displayed in the x window system was too small to read in a confy way:
This however is solved easily by going to fonts in the kde control module (configuration -> kde -> looknfeel -> fonts) and chance the size of the fonts displayed (and font itself if you choose to).
This does not change the size of the fonts in window/status bar the application: e.g. oowriter, If anyone knows how to chance the size of the fonts in the application itself, please let me know.
Questions 3,4 and 5 should be irrelevant, if indeed as you mention one can login as different useres simultanously.

So know, as recommended by JDW I added 2 users with Chinese locale: one for GB with chinput (simpuser 1)and one for Big 5 with xcin (simpuser2).

so here's my next set of questions ;-):
I log in as either simpuser1 or simpuser2

1) simpuser1 is working with oowriter but does not seem to work or even start with kmail: did I overlook something? and as for oowriter: sometimes chinput seems to open as a "DOS" like input screen with all possible characters listed horizontally (and correctly).
On other occasions however, it opens in a very small screen with a half white half red icon with the Chinese character zhong (middle) written in to it.
Then when I type pinyin, the possible characters are listed vertically and most of the possible entries are empty or I get a list of character that according to pinyin rules should not be there at all (when I type ma, I get "fu" entries for example).
Last but not least, when I type chinput in the konsole the message is "can't open input message service. The Chinese Input server is already activated. Does this mean that as long as I'm logged in as simpuser1, chinput is always automatically activated?


2) simpuser2 does not work at all:
when I try to open xcin & kmail in the konsole, I get the following message:
[1] 6789
XCIN (Chinese XIM server) version xcim 2.5.2.3.
(module ver: 20000831, syscin ver 200000210)
(use "-h" option for help)

xcin: locale "zh_TW.Big5" encoding "big5"
xcin error: IMOpenIM() with name "xcin" transport "X/" failed.
[1]+ Exit 255 xcin
[simpuser2@localhost simpuser2]$ kio (KDirWatch) : WARNING: KDirWatch: :removeDIR can't handle ''

when I try xcin & oowriter:
[1] 6856
XCIN (Chinese XIM server) version xcim 2.5.2.3.
(module ver: 20000831, syscin ver 200000210)
(use "-h" option for help)

xcin: locale "zh_TW.Big5" encoding "big5"
xcin error: IMOpenIM() with name "xcin" transport "X/" failed.
[1]+ Exit 255 xcin

Now clearly here's some fundamental error, the question is: where?
xcin was installed by default with Mandrake 9.2, so possibly it needs to be configured?

Last but not least a silly question:
In an earlier message you stated:
Quote:

while I am logged in as my main English user-name, I can log into my Chinese user at the same time.
How do you log in thru the command line? when I try to login thru the konsole, I get the message:
no utmp entry. You must exec "login" from the lowest level "sh". I've no clue as to where this should be done?


For Jiawen,

Thanks for the contribution.
As for the fonts, I'll dive in to that in a later stage, when I get it all configured in such a way that the system works with what I have now.

As for the Chinese Howto you mention: I came accross it, but when I started out 3 weeks ago I didn't even know how to login.
What I like about Mandrake 9.2 is that it comes with xcin and chinput by default so I did not have to worry about installing those applications.
I'll worry about fcitx in a later, hopefully more mature, stage of my life with Linux.

And thanks for the info on terminals. This also will be something to worry about later (if at all).

JDW 01-07-2004 04:27 PM

contemplations on Linux and Chinese wordprocessing
 
Hi fiets,

I will be brief as I am at work and they just don't understand! ;-)

1) font size in oowriter - can change it quite siomply in the toolbar next to the name of the font (can pick 28 point size for nice big fonts)

2) i notice that various apps do not work with chinput, here is a great suggestion, fcitx has just released its Version 2.0, which has a great zhineng pinyin input...go to www. fcitx.org for download and instructions on installation and use. just remember to change the XMODIFIERS line in your .bashrc file to export XMODIFIERS=@im=fcitx

fcitx has worked with every app I have tested it with, OOffice, KOffice, Kmail, Evolution, Mozilla Mail etc. can't be happier than that!

3) for xcin, you have to change 2 lines in the xcinrc file, asd follows :-
As root, edit the file /etc/chinese/xcin/xcinrc to change the following lines to "NO" (they are defaulted as "YES") :-

(define XCIN_HIDE "NO")
and
(define OVERSPOT_WINDOW_ONLY "NO")
that should solve the xcin problem...

4) to log into chinese user while in english user, start Konsole, and then type :

$ su chinese_user_name
$password :
$fcitx & kmail

et voila!

if you have further questions, keep asking! that's what this forum is all about...

cheers and have fun with that...

jdw

fiets 01-08-2004 07:07 PM

Quote:

I will be brief as I am at work and they just don't understand! ;-)
well, can't really blame them, neither do I ;-).

1 oowriter: I wasn't referring to the size of the font in the document, but to the size of the font in the status bars within the application itself (and not the x-window). It's incredibly small.

As for xcin: ok, I edited the xcinrc file and now at least xcin starts. Still I do not understand how to use it: I toggle with the trigger keys as described at the howto and indeed I do manage to get a few characters while pushing a random letter on my keyboard when set to Cantonese, Jianyi or other input methods, but not while set to pinyin: then I just see the pinyin I submitted. What's more, while set to whatever inout method, I do not see how to transfer the possible output to the application ( I opened kmail for testing)??

As for fcitx: this is what I dreaded most: to have to install a program not included in the default installation (being also one of the reasons why I thought about mandrake in the frist place...)
You know I've got about 3 kilos of Linux reference manuals around me and not a single manual helps out on easy reference e.g as to how to install. It's not the learning curve I fear about, it's the lack of any curve at all that I dread: I still feel like I'm drowning...
Now I downloaded fcitx which now resides in my documents section as a user. I opened it with Ark to try to read the documentation. Now guess what? Konqueror opens the html file, but can't read all the characters....Somehow I get the impression I'm turning round in circles.
Anyway, I got it installed and it looks promising (but so did xcin and chinput). Again though I do not see how to transfer the characters to the test application (again kmail).
And then there is this message in my console after I opened fcitx:
kdecore (KAccel): WARNING: g_bKillAccelOverride set, but received an event other than AccelOverride.

And I'm too 4 letter word tired now.....to be continued.

JDW 01-08-2004 08:25 PM

contemplations on Linux and Chinese wordprocessing
 
Hi,

Re the installation of new software, it is not that difficult, although to the newbie it is fairly daunting. From personal experience a lot of trial & error has been involved.

That being said, I found the installation of fcitx v2.0 in Mandrake 9.2 to be faultless, and if you only wish to use pinyin input & simplified Chinese for douments, emails etc then I wouldn't find it necessary to use either chinput or xcin, as fcitx seems to work well with anything that involves Chinese word processing.

In a nutshell, what I did to get it going was put the fcitx-2.0.tar.bz2 file (this is the source code file) into my /home/john/bin directory, where I unpacked it with the following command-line command in a Konsole window :-

$ tar jxvf fcitx-20..tar.bz2

have a read of the README files and any similar files that are there...

then I changed to the newly-created /home/john/bin/fcitx directory, and ran the following commands :-

$ make clean
$ make

this compiles the program on your system...

then I logged in as root user, as follows :-

$su
password :
then ran the following command :-

# make install

this step will actually install the fcitx program on your Linux system, and will install the executable (or binary) file in the /usr/bin directory (hence the need to do this command as root user, as this directory belongs to root).

log out of root (CTRL+D is the quickest way), then log in as your previously created simplified Chinese user (I call mine "GB"), and run the following command :-

$ fcitx & kmail

and it works!

Getting off the track a bit, Linux is a great learning curve, and I find that the best advice I ever read for learning Linux/Unix was to read the documentation at least three times before you attempt to do things. Linux requires a lot of effort, but when you realise that you don't need or rely on Bill's Windows anymore it is all worthwhile...

cheers...

fiets 01-11-2004 04:47 PM

Hi JDW,

I've been playing, toggling, trying and thinking a lot over the weekend with only moderate result:

as it is I've now created 3 different users, one for chinput, one for xcin and one for cfitx. I've been trying all 3 users with oowriter & kmail, the results so far:

chinput user

chinput & oowriter: it works somehow, at least I get to choose some characters: most of the numbers entries however are empty, I get to choose from characters that aren't even written that way in pinyin (e.g. I put in ma and get a character like fu) and when I choose the character what is put in the document is a completely different ma character).

chinput & kmail does not work at all, the character list doesn't even show

xcin user

xcin & oowriter: pinyin input and most others (that I hardly now how to use) does not work.

xcin & kmail: astonishingly xcin responds just as together with oowriter

fcixt

fcixt & oowriter: now this is a very intelligent im: fcitx works perfectly with oowriter.
(And evolution, which I also tried). First of all I could not believe it as this new 2.0 version only gives you the choice of 5 different characters only but it does work!
One snag or bug I discovered though: fcitx does not recognize nu (woman) at all, instead it gives you anger, fury. First I thought I did something wrong but if you try nu cesuo (women's toilet) you'll see my point.

fcitx & kmail: fcitx works, but I'm not able to copy the selected characters to the kmail document.

I tried to copy some Chinese with German special character text which was performed excellently in oowriter to kmail:
the Chinese was pasted perfectly but the German special characters disappeared.
Therefore I suspect the whole thing has got something to do with unicode settings, KDE font settings or maybe with Chinese fonts itself?

Are you using any other Chinese fonts than the ones that come with the mandrake 9.2 distro (the AR PI Kaitim, Mingti and Sungti)?
What font have you configured in KDE?

JDW 01-11-2004 08:14 PM

contemplations on Linux and Chinese wordprocessing
 
Hi Fiets,

There is no real need to create separate users for xcin, chinput & fcitx. You can get them working on the same user with different apps, but personally speaking, I am very happy just to use fcitx 2.0.

One thing I did on the weekend was install Mozilla Firebird browser & Thunderbird email client, wow, I am impressed with those, and the good news :- Firebird rendered the Chinese websites I visited quite nicely, and I could easily type emails in Chinese with Thunderbird/fcitx...I can highly recommend these lightweight, quick apps for browsing & emailing...(go to www.mozilla.org/ and hit the products tab)

typing "nü" - woman (yes, they give me anger & fury too, I'm married! ;-) is done by typing "nv", so "lüguan" - "hotel" will be entered by "lvguan"...too easy!

I'm not sure what you mean that you cannot copy or paste these characters, when you input some pinyin (e.g. "beijing") and you get 2 choices (1. Beijing, the city 2. beijing, meaning background), then you can press the space bar to enter the first selection, or the number to select any of the other selections - if I wanted to say background in this example, I would type "beijing" and then the number "2" and the characters will be automatically inputted into the document or app that you are using...

I've never tried Chinese with German special characters, so I cannot really help you there...

For (many) extra Chinese fonts, I trawled the web for sites where you can download all sorts of different styles of Chinese fonts, so give Google a try...have a good look around, some of these font providers charge a fortune...

cheers,

jdw

fiets 01-13-2004 10:35 AM

Quote:

There is no real need to create separate users for xcin, chinput & fcitx.
That somehow did the trick in may way of thinking! I thought one needed different users for different input managers.
But now I realise one just needs 2: one for GB and big5 each.

Realising that and noting your remarks on how to input "v" fpr "ü", I tried again and bingo! xcin now does work properly and perfectly, it all comes fdown to realising how the system works. I never found a document explaining how to use it, so it was just try and error.

So now I got both fcitx and xcin running properly, even though fcitx still does not work under kde applications (kmail, kwriter). I hope to sort this out in a later stage.


Quote:

'm not sure what you mean that you cannot copy or paste these characters
here I was referring to copying Chinese text created with fcitx from oowriter to kmail.

I already downloaded some extra fonts (and will try to see how I can install them and work properly. here's a good link for Chinese fonts

After I manage that, I will kind of make a draft for a mandrake 9.2 specific howto for newbies, including your remarks for your perusal before I publish it: then maybe we can have some other more experienced users to comment and add to it.

As for now, thanks ;-)!

JDW 01-13-2004 03:44 PM

contemplations on Linux and Chinese wordprocessing
 
Hi Fiets,

Maybe the KDE applications (Kmail, Kwrite) will work if you set your KDE settings as well to Simplified Chinese - sorry, I should have mentioned this before!

It's very easy to do - log out of your English (or German/Dutch) user and log into your chinese user with KDE.

From the main KDE menu, select Configuration/Accessability (this is in Mandrake 9.2, I am not sure about the default menu setup in other distros), and select "Country & Language".

Then set the country to P.R. China, and it will set the language to Chinese Simplified. Press "Apply/OK" and log out, and log in again, and then all the menus etc. in KDE will have changed. The standard KDE apps should all work now too with fcitx...

If you are going to do a proper How-To at tldp.org, I would like to be involved in some way and make my small contribution to the Linux community, albeit those members of the community who use Chinese text-processing! (well, there are probably a few througout China alone!).

cheers,

jdw

fiets 01-17-2004 04:46 PM


[b}To previous readers of this message: please note the message has been edited on January 19th after receiving new instructions from the author, Gerrit Fricke: see code at /home/.i18n has been changed but now everything works.

Also please note that a new revised manual will be uploaded shortly to be shown at the link address mentioned underneath where the original German text is displayed.

Further revisions might be added later on for those who want to be able to add a 3d, different language locale environment
[/b]


Howdy, JDW,

I've been trying and errowing these last few days.
In the mean time I found this. It's a manual written by Gerrit Fricke on how to display Chinese in a German environment.
It's basically what we want, however I've not been able to implement everything 100 % as Gnome applications (e.g. GIMP, GnuCash, Evolution) still do not display correctly in my western environment. This however may have to do with my own settings.

As it is, the article is written with the presumption to create a German environment with SCIM. I subsitituted German with Dutch and SCIM with fcitx and it works flawless for me in a KDE environment. I have no reason to doubt why it would not work in any other western language environment. After consulting Gerrit Fricke I translated the article. My comments are in a different colour in between:

quote

Problem: I installed everything but my IME (input method editor) will only start when I'm logged in with locale Chinese. But I don't like my menus to be Chinese. Do I have to chance locales every time I want to write Chinese or is there a method to activate the IME even when my desktop is localised to German?

This manual is to help all those that would like to be able to write Chinese with a German localised desktop without having to change the locale continuously.

My distro is Mandrake 9.1 with KDE 3.1.4. but this manual is supposed to work with Mandrake 9.0/9.1/9.2, in case you have any other distribution you will have to try yourself.. When installing Mandrake, I also installed the locales-de for German and locales-zh for Chinese. These are the locale packages from the installation CD's for German and Chinese support. Furthermore the font packages ttf-gb2312 and ttf-big5 should have been installed from the CD's as well as well as kde-i18-zh, the Chinese environment for the KDE desktop in case you want the desktop to be displayed in simplified Chinese and kde-i18-de for a German desktop.

Now, using LocaleDrake you are able to switch to Chinese quite easily. OK so far , but how do I write Chinese? Mandrake ships with Chinput and XCIN. Chinput does not work under Mandrake 9.1 (at least not the version on the distro CD) and XCIN is not really my thing. So what's next?

I downloaded SCIM from turbolinux. The default packages work flawless, even if there are some dependency problems with GTK2, which however you may circumvent quite easily by opening a console (as root) and by typing:

urpmi --allow-nodeps packagename

Obviously you will have to be in the directory with the rpm packages you want to install. GTK2 should be installed (which is usually installed by default with Mandrake 9.1).

You have to download and install scim (actual version scim-0.8.2-1.i586.rpm by the time of writing this article) and scim-chinese-0.2.6-1.i586 rpm (for pinyin input method)

last update of this online article was Nov. 8th 2003

Furthermore you have to modify the file /etc/X11/xinit/XIM (as root). Given the locale this file decides which IME is to be used and to be started at the same time. In case you want to use SCIM, you will have to delete everything that stands underneath:

Code:

zh_CN*) # Simplified Chinese
and replace it with
Code:

if type - scim > /dev/null 2>&1 ; then
export modifiers="@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. Now use LocaleDrake and change the language to simplified Chinese. Now log out and start KDE again. Now you are able to write Chinese: just press CTRL and SPACE and the IME starts.

even when setting fcitx as IME iso SCIM I got the Mandrake standard installed Chinput as IME at this point but this will be solved automatically later on

Unfortunately all IME's I'm aware of only work with the corresponding locale, in this case with simplified Chinese as the desktop language. Most people however prefer a Desktop completely in German while still being able to input Chinese. To achieve this open the .i18n file in your home directory (please note the dot in front, meaning it is a hidden file, so adjust your konqueror to show hidden files) and open the file with Kwrite. The contents of this file with Chinese locale should look something like this:

Code:

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"


Replace it with:

Code:

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

here I put nl_NL.UTF.8 for Dutch iso de.DE.UTF.8 and fcitx iso SCIM

Save. Very important are
Code:

LC_MESSAGES=de_DE.UTF-8
and
Code:

LANGUAGE=de_DE:de_DE.UTF-8:de
as these point to /usr/share/locale/de/LC_Messages , the directory that contains the translations of programs in German. This is to say we maintain simplified Chinese as the language for the desktop but the files for the applications are being retrieved from the directory with the German translations. OK, now log out and start KDE again.
obviously for Dutch I put in Languague=nl_NL:de_DE.UTF-8:nl iso LANGUAGE=de_DE:de_DE.UTF-8:de

There you are! KDE in German and you can still input Chinese! But these terrible fonts! How do we change them? Go the the KDE configuration center and change the font overthere into our favorite one (in my case helvetica or arial). Now KDE looks decent again. But what about GTK2 applications? They apparently still use the font AR PL SungtiL GB. That's may be fine for Chinese applications, but look terrible with the latin alphabet. So we'll make a file called .gtkrc-2.0 .Write

Code:

gtk-font-name="fontofyourchoice 10"
And save it to your /home directory. Fontofyourchoice may be helvetica or whatever you prefer and you may also change the size.

GTK1 applications now still look messy. You can change that by opening /etc/gtk/gtkrc.iso-8859-15 with Kwrite as root and save it as /etc/gtk/gtkrc.zh_CN.utf8. Before you do so however, make sure you save the original file /etc/gtrk/gtkrc.zh_CN.utf8under a different name , e.g. /etc/gtk/gtkrc.zh_CN.utf8-original . You can never tell, mayvbe someday you would still like to have a Desktop in Chinese.
Now GIMP 1.2 or GRIP should also contain the fontofyourchoice, that you may change anytime by modifying /etc/gtk/gtkrc.zh_CN.utf8.

Now you're ready configuring. A German desktop, Chinese IME and the fonts of your choice.
that is, a Dutch desktop for me...


Special remarks for OpenOffice:
As this suite does not recognize "OnTheSpot-Modus", you will have to delete this option while setting up SCIM under (B]Frontend/X Window[/B]. At the same time deactivate the "show status" box. Please make sure you have installed OpenOffice 1.1 or upgrade as this version finally supports CJK decently.
Now configure the options under tools/options/language settings. For mixed documents make sure you have German iso standard/default. as the locale setting. Now in case you write a mixed Chinese/German document, you are able to use different fonts for German and Chinese, in case you configured OpenOffice under tools/options/textdocument/basic fonts (western, asian). As default for simplified Chinese you should use AR PL KaitiM GB or AR PL SungtiL Gb. In case you have installed windows fonts you can also use Simsun or SimHei.

OpenOffice works perfectly for me with these settings in Dutch environment

Have fun toggling Chinese.

This manual is to be used at your own risk. The author is neither liable for any damages nor can he exclude any errors. However this document has been written to his best knowledge.

This text is published under the GNU free document licence (FDL). In case you pass it on, please do so only when mentioning the name of the author.

copywright Gerrit Fricke
published on Pro Linux, last update November 8th 2003

unquote

Gerrit Fricke has been informed on the translation published here and who knows, he might join us in our contemplations.
Where nearing the Linux nirvana as far as this topic is concerned and as soon as I've been able to get my GNOME applications working under a proper Dutch environment, I'll have reached my destination.

So JDW, give it a try and tell me what you think about it. Just remember that with this setting, your solution does not work anymore, so make an appropriate back up before you try it out (and it takes some time, so don't do it in your lunch break ;-).

hasta la pasta,

Jiawen 01-30-2004 01:18 PM

I hope it's okay if I add something here. I've got similar problems...

Inspired by Fiets' experience with SCIM, I decided to try installing it again. I got it installed via RPMs, then changed three different files: /etc/sysconfig/i18n, /etc/X11/xinit/xinitrc and /etc/X11/xinit/XIM. I changed them as I've seen indicated on this and other threads. I restarted Gnome, and SCIM was working fine. At least, it works fine in OpenOffice.org. In Firebird, Quanta and seemingly other programs, the character choice bar refuses to open, even though the main control bar comes up and stays up. I therefore can't do input in anything but OpenOffice.org, it seems.

I have two questions:

1) How do I get the character chooser bar to come up in Firebird, Quanta, etc.? Perhaps I haven't really fully installed SCIM?

2) Is there any way to specify tones in SCIM? Intelligent Pinyin is great, but it would be even faster if I could actually designate tones, instead of having to page through the whole list.

I am using Mandrake 9.1 with Chinese-Taiwan locale and Big5 traditional characters.

Thanks in advance for any help!

fiets 01-31-2004 11:41 AM

Howdy Jiawen,

Quote:

Inspired by Fiets' experience with SCIM
First of all please note: I don't think I have any experience with SCIM, I installed fcitx. But the author of this manual used SCIM, so that should not be the problem.
You mention you changed various files as mentioned in this and other threads. I'm not proficient enough in the whole matter to be able to answer your questions. Maybe there are counterproductive hints in various threads. I started from (virgin) scratch and it all worked for me. Furthermore you mention you changed "/etc/X11/xinit/xinitrc" and folllowing the manual, I do not recall I changed that.

I'm not sure about firebird, but Quanta certainly is a GTK application. Does it work in KDE applications like kmail? And what about Gnome applications in general?

I'll leave it up to others to comment on the specifics of SCIM in general.

If anything else comes to mind, I'll get back on this.


All times are GMT -5. The time now is 05:10 PM.