# Chinese support but system in english + learn chinese

## tane_stelzer

Hi there, well i dont speak chinese neither can i understand it, but still i do have a lot of chinese music on my computer, aswell as japanese and some korean. Now i would like to be able to display that, but not quite sure how, most of the thread are for converting completly to chinese but i want to keep my english system, and just be able to see chinese in amarok gaim file manager(i use filer and gentoo), and of course i want to be able to see chinese on websites(not for me but for my frds if they want to check emails or check sth).

And secondly my girlfriend always wants me to learn chinese, just i am a very lazy person and need someone to kick me hard, so i thought maybe there is a programm out there which will slowly introduce me and then maybe after a couple of months understand a bit more, but it has to be easy at the beginning hehe. 

I hope someone can help me, but I am sure someone can, from what i have read so far ( the parts i was able to understand ie english) you seem to be a bit more friendlier then the general forum.

Thx anyway

Tane

----------

## tysn

You may simply copy a Chinese font to the right path in your system, if your locale is utf8.

But before that you must make sure your glibc was compiled to support zh_CN.UTF-8

a /etc/locales.build maybe like this:

```
en_US/ISO-8859-1

en_US.UTF-8/UTF-8

zh_CN/GB18030

zh_CN.GB2312/GB2312

zh_CN.UTF-8/UTF-8
```

tysn

----------

## cowboy

1. Set system encoding to UTF-8,(maybe en_GB.UTF-8 suit for you )

2. Emerge cjkuni-fonts

3. Add USE "cjk" "nls" to make.conf (optional but recommend)

4. Your girlfriend is Chinese ! ?  :Laughing: 

----------

## Hauser

I'm using an English system, but I can see and input Chinese fonts.  Here's my /etc/locales.build:

```
en_US.UTF-8/UTF-8

en_US/ISO-8859-1

zh_CN.GB18030/GB18030

zh_CN.GBK/GBK

zh_CN.UTF-8/UTF-8

zh_CN/GB2312

zh_HK.UTF-8/UTF-8

zh_HK/BIG5-HKSCS

zh_TW.EUC-TW/EUC-TW

zh_TW.UTF-8/UTF-8

zh_TW/BIG5

```

After copying some fonts into /usr/share/fonts, add the path of the Chinese font directory into /etc/X11/xorg.conf. You also need to set the locale in your ~/.xinitrc (~/.bashrc if you use xdm), like

```
export LC_CTYPE=zh_CN.GBK
```

This one line is enough. Which locale to set depends on how your Chinese files were created, you may need to do some testing to find the correct locale.

You may also need to do a 'emerge -uDN world' with USE flags "cjk" and "nls" to get full Asian language support.

P.S. You may also need to add the Chinese, Korean, or Japanese charsets in kernel, they are located in File systems -> Native Language Support.

----------

## tane_stelzer

Oh cheers i wil try all of that out once i come back later, if i encounter any problems i will come back and ask

thx very much

Tane

edit: to set the locales i should just use the localization guide on gentoo.org?

And do i have to follow the stepts everyone mentioned or whose steps should i follow???? 

CHeers

tane

----------

## tysn

you should just follow the stepts metioned by Hauser:)

1, edit the /etc/locales.build to suport Chinese, and then re-emerge your glibc

2, copy some Chinese fonts into /usr/share/fonts, add the Chinese fonts' path into /etc/X11/xorg.conf

3, set your locale somewhere, like "export LC_CTYPE=zh_CN.UTF-8"

4, other things to pay attention to

enjoy it!

tysn

----------

## tane_stelzer

So for 1. it is okay to just follow the localization guide http://www.gentoo.org/doc/en/guide-localization.xml  and re-emerge glibc is just 

```
emerge glibc
```

for 2 which fonts should i use and how do i copy them into fonts and what line do i have to add to /etc/X11/xorg.conf

well i dont complete chinese will i still keep everything in english when i set my locals to 

```
export LC_CTYPE=zh_CN.UTF-8
```

 and just be able to see chinese?

Well i am sorry but i really would like to understand what i am doing i have a couple of other problems atm and i dont want to create anymore so id rather ask twice.

Thanks very much for your replies so far anyway

Tane

----------

## Hauser

 *tane_stelzer wrote:*   

> So for 1. it is okay to just follow the localization guide http://www.gentoo.org/doc/en/guide-localization.xml  and re-emerge glibc is just 
> 
> ```
> emerge glibc
> ```
> ...

 

If you have not used "userlocales" USE flag when you built your system, maybe you don't need to recompile glibc. Type

```
$ locale -a | grep zh
```

If you see things like zh_CN, zh_CN.gb18030, zh_CN.gbk, zh_CN.utf8, zh_HK, etc., skip the glibc part. If you see nothing, then you'll have to add those locales to /etc/locales.build and re-emerge glibc.

 *tane_stelzer wrote:*   

> ...
> 
> for 2 which fonts should i use and how do i copy them into fonts and what line do i have to add to /etc/X11/xorg.conf
> 
> ...

 

The Chinese fonts in portage include zh-kcfonts, twmoefonts, hkscs-ming, and arphicfonts. The arphicfonts are probably more useful than others because both Simplified and Traditional Chinese fonts are included. Just emerge them as usual, they should be installed in the /usr/share/fonts directory. As to /etc/X11/xorg.conf lines, they are in the "Files" Section, just look at it and you'll know how to edit it.

 *tane_stelzer wrote:*   

> ...
> 
> well i dont complete chinese will i still keep everything in english when i set my locals to 
> 
> ```
> ...

 

Yes and no.  In general, your interface will be in English and you should be able to see and input Chinese in a file, browser, and so on. But if your Chinese files were created in a locale environment other than zh_CN.UTF-8 (say zh_CN.GBK as in a Simplified Chinese windows), you would not be able to see the filename correctly if it's in Chinese; that's why I said you might need to do a bit testing.

Moreover for the filenames in Chinese or other Asian languages to show themselves correctly, you may need to recompile the kernel as I mentioned.

----------

## tane_stelzer

Ok that is really helpful thx just one last question, if i cant see the chinese correctly as u mentioned,is there a way to change it to utf8,so that i would be able to read it??

----------

## Hauser

 *tane_stelzer wrote:*   

> ...if i cant see the chinese correctly as u mentioned,is there a way to change it to utf8,so that i would be able to read it??

 

I'm not sure if there's any tools to do such things. If you can't find one, try the following. Find the correct locale first so that you can read the filenames. Copy and paste the filenames into a text file; at the same time do some indexing so that you know which filename corresponds to which file. Restart X with the utf8 locale, open the text file with an editor such as kwrite, switch to the correct 'Encoding' so that you can read those Chinese names. Rename those files by copying and pasting from that textfile. It's pretty troublesome, but since you can't input Chinese, this is the only way I can think of.

----------

## tane_stelzer

Okay well i hope it will work, i tried it but it didnt work, it said at boot up that it failed to load local, but i think i know the problem just haven't had time to correct it, so which is a good input method, scim is the one i used on ubuntu, but i really didnt like the fonts at all. i hope those simple trad ones are nicer to look at hehe even i dont understand, well for input maybe jsut ask my gf to write everything for me? oh i was wondering to input trad, is there sth like pinyin?? Or do you have to use that weird system where each letter key represents some symbol and you ahve to make up complex characters from those, i think that is what the standard one is on windows? is there an easier one for trad??

Tane

----------

## Hauser

 *tane_stelzer wrote:*   

> ... scim is the one i used on ubuntu...

 

You've used scim before?  :Exclamation: 

----------

## cowboy

 *tane_stelzer wrote:*   

> Ok that is really helpful thx just one last question, if i cant see the chinese correctly as u mentioned,is there a way to change it to utf8,so that i would be able to read it??

 

convmv

convert filenames to utf8 or any other charset

http://packages.gentoo.org/search/?sstring=convmv

id3iconv

to convert ID3 tags in mp3 files from whatever machine encoding you have (GB2312/GBK for Chinese, etc) to Unicode

http://www.cs.berkeley.edu/~zf/id3iconv/

cjkuni-fonts

Full sized CJK unicode truetype fontset

http://packages.gentoo.org/ebuilds/?cjkuni-fonts-0.0.20050501

----------

## tane_stelzer

well i had it installed, its not that i cant write single words but i cant make any sentences, but yeah just would like to have that on again with nicer fonts i think cowboy gave them to me so how do i get scim up and running? well maybe i should just do the locals first still havent corrected my mistake

----------

## tane_stelzer

OK i did my best to follow your instructions, but i think i made some kind of mistake. Well here is what i did.

i checked 

```
ls /usr/share/locale/
```

 and the output was 

```
C      cy           et_EE  ia            mk     pt       ta       yi

af     da           eu     id            ml     pt_BR    te       yo

am     de           eu_ES  is            mn     rm       tg       zh

ang    de_AT        fa     it            mr     ro       th       zh_CN

ar     el           fi     ja            ms     ru       tk       zh_CN.GB2312

as     en           fr     ka            my_MM  ru_RU    tl       zh_TW

az     en@boldquot  ga     kn            nb     rw       tr       zh_TW.Big5

az_IR  en@quot      gl     ko            ne     sk       ug       zu

be     en_AU        gr     ku            nl     sl       uk

bg     en_CA        gu     li            nn     sp       uk_UA

bn     en_GB        he     locale.alias  no     sq       uz

br     en_US        hi     lt            nso    sr       uz@Latn

bs     eo           hr     lug           or     sr@Latn  vi

ca     es           hu     lv            pa     sr@ije   wa

cs     et           hy     mi            pl     sv       xh

```

then i wrote the locales into /etc/locales.build

here is what cat says

```
en_US/ISO-8859-1

en_US.UTF-8/UTF-8

ja_JP.EUC-JP/EUC-JP

ja_JP.UTF-8/UTF-8

ja_JP/EUC-JP

en_HK/ISO-8859-1

en_PH/ISO-8859-1

de_DE/ISO-8859-1

de_DE@euro/ISO-8859-15

es_MX/ISO-8859-1

fa_IR/UTF-8

fr_FR/ISO-8859-1

fr_FR@euro/ISO-8859-15

it_IT/ISO-8859-1

zh_CN/ISO-8859-1

zh_CN.UTF-8/UTF-8

zh_CN.GB2312/ISO-8859-1

zh_CN.GB2312.UTF-8/UTF-8

zh_TW/ISO-8859-1

zh_TW.UTF-8/UTF-8

zh_TW.Big5/ISO-885901

```

All the zh_CN i added the i re-emerged glibc just like you said

then i emerged teh arphicfonts and added the line into xorg.conf

then i did 

```
export LC_CTYPE=zh_CN.UTF-8
```

then i rebooted and i still couldnt see the chinese.i checked in amarok and in filer( my file manager also in xterm and nth showed me chinese.

Tane[/code]

----------

## kohno

Do you mean to say you can't see Chinese filenames or you can't see any Chinese at all? Try this website with your brower: http://www.yahoo.com.cn/ Can you see the Chinese fonts? What does the command "locale -a" show?

BTW what filemanager are you using? Not like Gnome-terminal or Konsole, you need do some setting up to make xterm show Chinese.

----------

## tane_stelzer

Well i can see the chinese on that website, but i cant see chinese filesnames in amarok and filer. Filer is the name of my file manager, and how to i setup xterm to see chinese??? Well maybe get it to work in amarok first is the most important to me then also filer. So is my /etc/locales.build right cos i thought that is where the mistake is, it kind of looks wrong or imcomplete too me.

----------

## kohno

If you can see Chinese with your browser, your fonts are installed ok. AFAIK, filer and xterm don't support Chinese very well, I don't know how to set them up. I would switch to rxvt or mlterm if I were you.

You should append your /etc/locales.build as posted by Hauser and make sure you use the "userlocales" USE flag when you recompile glibc. 

As to amarok, have you done "emerge -uDN world" with "cjk" and "nls" USE flags? At the very least you should recompile xorg-x11.

If "export LC_CTYPE=zh_CN.UTF-8" doesn't work, have you tried "export LC_CTYPE=zh_CN.GBK" and others? Whenever you restart X, you should first check your locale by typing "locale | grep LC_CTYPE".

----------

## tane_stelzer

Okay i will change to rxvt, as emerge -uDN world i get an error here it is

```
Traceback (most recent call last):

  File "/usr/bin/java-config", line 14, in ?

    from java_config import jc_options

ImportError: No module named java_config

!!! ERROR: net-dns/libidn-0.5.15 failed.

!!! Function src_compile, Line 25, Exitcode 0
```

and locale | grep LC_CTYPE just gives me POSIX what ever that is? but iw ill try to export some other.

thx a lot hope i can solve that problem soon

Tane

----------

## kohno

 *tane_stelzer wrote:*   

> and locale | grep LC_CTYPE just gives me POSIX what ever that is? but iw ill try to export some other.
> 
> 

 

That means you don't have zh_CN.UTF-8 built in, so probably you didn't compile glibc properly.

----------

## tane_stelzer

Okay i am just emerging glibc again, and how about that error when i tried to emerge world do you know anything about that?

----------

## tane_stelzer

Okay i did emerge glibc and i did use the locales Hauser gave me i still get Posix and no zh_CN or anything my useflags contained cjk and nls

----------

## kohno

Please post the result of "locale -a" and the content of your ~/.xinitrc.

----------

## tysn

maybe you have not used the "userlocales" USE flag when you recompiled glibc?

```
echo "sys-libs/glibc userlocales" >> /etc/portage/package.use
```

----------

## tane_stelzer

Okay, well due to a big problem with portage i had to reinstall gentoo now, i emerged glibc before i emerged anything else, and i watched i closly so i think i got it working now but first have to get everything runnig i will get back too you once i am able to judge this, thx very much

oh yeah one last question, what is a good music player to play chinese and it should be as light as possible thx very much for everything

Tane

----------

## tane_stelzer

Okay i set up my gentoo boz again, but still no chinese at all this is really driving me crazy,err   :Evil or Very Mad: 

Well as requested here is the output of locale -a

```
C

POSIX

de_DE

de_DE@euro

en_HK

en_PH

en_US

en_US.utf8

es_MX

fa_IR

fr_FR

fr_FR@euro

it_IT

ja_JP

ja_JP.eucjp

ja_JP.utf8

zh_CN

zh_CN.gb18030

zh_CN.gbk

zh_CN.utf8

zh_HK

zh_HK.utf8

zh_TW

zh_TW.euctw

zh_TW.utf8
```

and my .xinitrd is here not that there is a lot in it but anyway here it is

```
exec startfluxbox
```

I hope someone can help me with this please

thanx very much for your support so far,

Tane

----------

## cowboy

AFAIK, fluxbox does not has any I10N support. 

What type of partition are your mp3 in? fat? ext3?

post your output of " locale" (without -a)

I use beep-media-player to play my musics.

----------

## tane_stelzer

Well if fluxbox doesnt support it that is okay, i just really need to be able to see them in my music player i installed bmp, it looks okay, but i firstly didnt want to emerge that i did have same problems with it before but it seems to be okay now, i think i still have to convert all my songs though.

so there is no chinese in fluxbox what a pity, well thanks for the reply. But i can still use scim or???

Tane

----------

## Hauser

 *tane_stelzer wrote:*   

> ...
> 
> and my .xinitrd is here not that there is a lot in it but anyway here it is
> 
> ```
> ...

 

Where's your "export LC_CTYPE=zh_CN.gbk"?

----------

## tane_stelzer

Do i have to add that to the .xinitrc???? i thought just write it into a terminal???

----------

## cowboy

http://www.scim-im.org/wiki/documentation/installation_and_configuration/gentoo

http://www.scim-im.org/wiki/documentation/installation_and_configuration/all/system_configuration

----------

## tane_stelzer

and that will work fine for fluxbox too?? well i will install it then thanks very much

Tane

----------

## Hauser

 *tane_stelzer wrote:*   

> Do i have to add that to the .xinitrc???? i thought just write it into a terminal???

 

Of course, please read my posts carefully!

 *tane_stelzer wrote:*   

> and that will work fine for fluxbox too?? well i will install it then thanks very much
> 
> Tane

 

All these locale, input method set-ups are independent of window managers.

----------

## tane_stelzer

Thank you very much, i think that did it for me thanks so much

Tane

----------

## tane_stelzer

Okay i got the Chinese working to work all fine, but now i am back cos of a problem with scim. Well as already mentioned i use fluxbox, i have scim scim-table and pinyin package(cant remember the name) emerged, i can start scim and it shows a tray icon in the taskbar but when ever i want to change to chinese with Ctrl + Space nth happens if i left click on the tray icon nothing happens either? Did i do anything wrong here???

Well i didnt bother opening a new thread i hope that is ok

Thx very much

Tane

----------

## Fleta

Have you put 'scim -d & export XMODIFIERS=@im=SCIM' in your ~/.xinitrc?

----------

## tane_stelzer

Thx a lot for the reply i tried it but it didnt work, nothing started when i logged in. What else could be wrong

thx a lot for the reply

Tane

----------

## Fleta

Have you installed scim-chinese?

----------

## Halahad

You should set your LC_CTYPE to zh_CN.UTF8, it works for me.

This is what my .xinitrd looks like:

```
export LC_ALL="en_US.UTF8"

export XMODIFIERS=@im=SCIM    

export GTK_IM_MODULE=xim

export QT_IM_MODULE=xim

exec gnome
```

----------

## EG

I think the above method is too complex for a normal user, my solution may be a little easier:

1.add USE="unicode" to /etc/make.conf

2.run emerge --newuse system

3.run emerge --newuse world

4.export LC_ALL="en_US.UTF-8" if you want to see english

5.export LC_ALL="zh_CN.UTF-8" if you want to see chinese

Now you can input any language that the unicode support, if you can't, the program you run either have a bug or lack of unicode feature, not you & me fault   :Very Happy: 

----------

