LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Chinese input in English environment (https://www.linuxquestions.org/questions/slackware-14/chinese-input-in-english-environment-525179/)

satimis 02-03-2007 03:10 AM

Chinese input in English environment
 
Hi folks,

Slackware-11.0
KDE 3.5


Please advise;
1)
How to read Traditional/Simplified Chinese in English environment

2)
How to add Traditional Chinese input in English environment


I have been googling around. What I can find was to change it to Chinese environment with menu in Chinese.

TIA


B.R.
satimis

David the H. 02-03-2007 05:44 AM

See here: Multilingual Text Support on Linux.

Short form: Make sure you're running a UTF-8 language environment, then install scim and a supported Chinese IME program.

diskoe 02-04-2007 09:28 PM

Quote:

Originally Posted by satimis
Hi folks,

1)
How to read Traditional/Simplified Chinese in English environment

Look at my response in this thread:
http://www.linuxquestions.org/questi...d.php?t=520151

Quote:

Originally Posted by satimis
2)
How to add Traditional Chinese input in English environment

I have not had to do any input, so I can't answer this one.

satimis 02-12-2007 04:46 AM

Hi David the H.

Tks for your advice and link.

The above refers to Debian. The files mentioned there can't be found on slamd64-11.0. I made full installation of slamd64-11.0

ls /usr/X11/lib/X11/locale/
Code:

C                iso8859-1  iso8859-6    ko_KR.UTF-8      microsoft-cp1256  zh_CN
armscii-8        iso8859-10  iso8859-7    koi8-c            mulelao-1        zh_CN.UTF-8
compose.dir      iso8859-11  iso8859-8    koi8-r            nokhchi-1        zh_CN.gb18030
el_GR.UTF-8      iso8859-13  iso8859-9    koi8-u            pt_BR.UTF-8      zh_CN.gbk
en_US.UTF-8      iso8859-14  iso8859-9e  lib              tatar-cyr        zh_HK.UTF-8
georgian-academy  iso8859-15  ja          lib64            th_TH            zh_HK.big5
georgian-ps      iso8859-2  ja.JIS      locale.alias      th_TH.UTF-8      zh_HK.big5hkscs
ibm-cp1133        iso8859-3  ja.SJIS      locale.dir        tscii-0          zh_TW
iscii-dev        iso8859-4  ja_JP.UTF-8  microsoft-cp1251  vi_VN.tcvn        zh_TW.UTF-8
isiri-3342        iso8859-5  ko          microsoft-cp1255  vi_VN.viscii      zh_TW.big5

Code:

# ls /usr/X11/lib/X11/locale/zh_CN
Compose  XI18N_OBJS  XLC_LOCALE

Quote:

Short form: Make sure you're running a UTF-8 language environment, then install scim and a supported Chinese IME program.
# slackpkg search scim
Code:

No package contains the selected pattern.
scim is not on the repositories.

Where can I get scim. TIA

B.R.
satimis

satimis 02-12-2007 05:00 AM

Hi diskoe,

Quote:

Look at my response in this thread:
http://www.linuxquestions.org/questi...d.php?t=520151
Tks for your URL.

Where can I downloamd zh-arphicttf-2.11.tar.gz?

The sites "ftp://freebsd.sinica.edu.tw/pub/keith/" seems not working. Tks.


B.R.
satimis

titopoquito 02-12-2007 05:26 AM

Google is your friend. There are many FreeBSD mirrors.

ftp://ftp.freebsd.org/pub/FreeBSD/po...tf-2.11.tar.gz

satimis 02-12-2007 09:51 AM

Hi titopoquito

Tks.

satimis

satimis 02-12-2007 09:59 AM

Hi diskoe,

# which mkfontscale
Code:

which: no mkfontscale in (/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin)
# which mkfontdir
Code:

which: no mkfontdir in (/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin)
They are not installed.

I suppose mkfontscale, mkfontdir, etc. coming from xorg-x11-font-utils

# slackpkg search xorg-x11-font-utils
Code:


No package contains the selected pattern.

not available on repositories.

Where can I find the package xorg-x11-font-utils for slamd64. Googling did not find it. Tks.


B.R.
satimis

titopoquito 02-12-2007 10:12 AM

You find those applications in /usr/X11R6/bin -- in stock Slackware and in Slamd64.

lchxr 02-14-2007 02:29 PM

Suppose you need an English environment with Chinese support.

For chinese display
1. install kdei (in slackware-11.0-CD3)
Code:

kde-i18n_kde-i18n-zh_CN-3.5.4-noarch-1.tgz  <--- for Simplified Chinese suuport.
kde-i18n-zh_TW-3.5.4-noarch-1.tgz  <--- for Tranditional Chinese support.

2. install fonts. There are many options.
(a) Copy TTF fonts from Windows to Slackware (sim*.ttf)
(b) Download TTF fonts from http://www.ctan.org/tex-archive/fonts/arphic/
Code:

gbsn00lp-20050720.tar.gz  <--- simplified Chinese fonts
gkai00mp-20050720.tar.gz  <--- simplified Chinese fonts
bkai00mp-20050720.tar.gz  <--- BIG5 fonts for traditional Chinese
bsmi00lp-20050720.tar.gz  <--- BIG5 fonts for traditional Chinese

(c) Download WQY fonts from
http://wqy.sourceforge.net/cgi-bin/enindex.cgi

Install Chinese fonts as TTF fonts as other post discussed.
Then you can read Chinese without problems.

For Chinese input
3. Install SCIM,
Code:

wget http://downloads.sourceforge.net/scim/scim-1.4.5.tar.gz
tar zxvf scim-1.4.5.tar.gz
./configure --prefix=/usr
make && make install

4. Install IME engine
Code:

wget http://downloads.sourceforge.net/scim/scim-pinyin-0.5.91.tar.gz
tar zxvf scim-pinyin-0.5.91.tar.gz
./configure --prefix=/usr
make && make install

Configure SCIM
5. setup locale
Code:

export LANG=en_US.UTF-8
or if you would like to set up locale globally, edit /etc/profile.d/lang.sh if you are using bash.
Code:

#File /etc/profile.d/lang.sh

#export LANG=en_US
export LANG=en_US.UTF-8

6. setup environment variables
Code:

export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim

7. invoke Chinese input method. From a console, type
Code:

scim -d
8. If you edit file in kedit or kate, you can hit Ctrl+SPC to active pinyin input.

I cannot active "Pinyin Input" in vim or emacs. If you have a solution for vim and emacs editor, please post here.

I have created scim.Slackbuild, scim-pinyin.SlackBuild, scim-fcitx.SlackBuild, and *-.tgz for my own use. I don't know how to upload.

BCarey 02-14-2007 08:37 PM

Hi,

I followed your instructions, and everything seems okay, just that when I press Ctl-Space nothing happens. (I have tried to do Chinese input in the past, and always get stuck on this point.) Can you help me? Is there any other way to invoke the input method other than Ctl-Space?

Thanks,
Brian

satimis 02-17-2007 04:27 AM

Hi lchxr,


Tks for your advice.

Following diskoe's advisce above Traditional Chinese can be displayed without problem.

Now I'm prepared to install Traditional Chinese input

Quote:

Suppose you need an English environment with Chinese support.

1. install kdei (in slackware-11.0-CD3)
Code:

kde-i18n_kde-i18n-zh_CN-3.5.4-noarch-1.tgz  <--- for Simplified Chinese suuport.
kde-i18n-zh_TW-3.5.4-noarch-1.tgz  <--- for Tranditional Chinese support.


IIRC I made full installation of slamd64-11.0 except Game. Is there any way to recheck them?

Quote:

3. Install SCIM,
Code:

wget http://downloads.sourceforge.net/scim/scim-1.4.5.tar.gz
tar zxvf scim-1.4.5.tar.gz
./configure --prefix=/usr
make && make install


I have scim-1.4.5.tar.gz download on the box.

Quote:

4. Install IME engine
Code:

wget http://downloads.sourceforge.net/scim/scim-pinyin-0.5.91.tar.gz
tar zxvf scim-pinyin-0.5.91.tar.gz
./configure --prefix=/usr
make && make install


What package shall I download for Cangjie and Easy Traditional Chinese input? Where can I find them? Tks

Do I need to install;
scim-gtk2-immodules
scim-modules-socket
scim-tables-zh

If YES where can I download them. TIA


B.R.
satimis

lchxr 02-19-2007 03:51 PM

Quote:

when I press Ctl-Space nothing happens. (I have tried to do Chinese input in the past, and always get stuck on this point.)
This can usually happen. Please check your locale and XMODIFIERS
Code:

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
$ echo $XMODIFIERS
@im=SCIM
$

You can also try LANG=zh_CN.UTF-8 to see if it helps.

Quote:

Is there any other way to invoke the input method other than Ctl-Space?
No, to my knowledge. But you can run scim-setup to change the hot-key.

lchxr 02-19-2007 04:25 PM

Quote:


What package shall I download for Cangjie and Easy Traditional Chinese input? Where can I find them?
You need scim-tables, download from http://downloads.sourceforge.net/sci...s-0.5.7.tar.gz

I am not sure if scim-gtk2-immodules and scim-modules-socket are necessary. I have installed Dropline Gnome. In my Slackware 11.0 I have
Code:

$ ls /etc/gtk-2.0
gdk-pixbuf.loaders  gtk.immodules
$


satimis 02-19-2007 10:31 PM

Hi lchxr,


Tks for your advice and URL. Performed following steps;

# ls /etc/gtk-2.0
Code:

gdk-pixbuf.loaders  gtk.immodules
Download
scim-1.4.5.tar.gz
scim-tables-0.5.7.tar.gz

Ran
# tar zxf scim-1.4.5.tar.gz
# tar zxf scim-tables-0.5.7.tar.gz

# cd /path/to/scim-1.4.5
# ./configure --prefer=/usr
# cd /path/to/scim-tables-0.5.7
# ./configure --prefer=/usr
Both went through without complaint.

# export LANG=en_US.UTF-8
# export XMODIFIERS="@im=SCIM"
# export GTK_IM_MODULE=xim
# export QT_IM_MODULE=xim
# scim -d
Code:

scim: error while loading shared libraries: libscim-1.0.so.8: cannot open shared object file:
No such file or directory

# find / -name libscim
No printout

Which package provides "libscim-1.0.so.8"? Where can I download it? Tks.

What is the difference between
- running "export LANG=en_US.UTF-8"
and
- adding it on /etc/profile.d/lang.sh

Tks


B.R.
satimis

lchxr 02-20-2007 07:40 AM

Quote:

Originally Posted by satimis
# tar zxf scim-1.4.5.tar.gz
# tar zxf scim-tables-0.5.7.tar.gz

# cd /path/to/scim-1.4.5
# ./configure --prefer=/usr
# cd /path/to/scim-tables-0.5.7
# ./configure --prefer=/usr
Both went through without complaint.

Have you done make && make install?

satimis 02-20-2007 08:12 AM

Hi lchxr,

slamd64-11.0

Quote:

Have you done make && make install?
Sorry I could not trace the record. Therefore I did them again.

bash-3.1# cd scim-1.4.5
bash-3.1# ./configure --prefix=/usr
bash-3.1# make && make install

bash-3.1# cd ..
bash-3.1# cd scim-tables-0.5.7
bash-3.1# ./configure --prefix=/usr
bash-3.1# make && make install

Both went through without complaint.

bash-3.1# export LANG=en_US.UTF-8
bash-3.1# export XMODIFIERS="@im=SCIM"
bash-3.1# export GTK_IM_MODULE=xim
bash-3.1# export QT_IM_MODULE=xim
All went through without complaint

bash-3.1# scim -d
Code:

Smart Common Input Method 1.4.5

Launching a SCIM daemon with Socket FrontEnd...
Loading simple Config module ...
Creating backend ...
Loading socket FrontEnd module ...
Starting SCIM as daemon ...
Launching a SCIM process with x11...
Loading socket Config module ...
Creating backend ...
Loading x11 FrontEnd module ...
GTK Panel of SCIM 1.4.5

Starting SCIM as daemon ...
SCIM has been successfully launched.

On Xfce4 desktop started kedit

[Ctrl]+[space] no effect. Chinese editing did not start.

started kwrite. Result was the same.

B.R.
satimis

lchxr 02-20-2007 05:45 PM

no idea at the moment. I will post here if I get the result.

lchxr 02-20-2007 07:02 PM

Hi, satimis,

Quote:

On Xfce4 desktop started kedit

[Ctrl]+[space] no effect. Chinese editing did not start.
How do you start kedit, from command line in xterm or from xfce desktop menu?

Because you export environment variables manually from the console, only applications from the same shell can see these variables, so you need to start kedit/kate/kwrite from command line in the same console. If you start editors from the desktop menu, the editors will not see these variables.

To overcome this, I set the LANG variable globally in /etc/profile.d/lang.sh (or /etc/profile.d/lang.csh if you are using csh)
Code:

# File: /etc/profile.d/lang.sh
LANG=en_US.UTF-8

Also I put these lines in my ~/.bashrc
Code:

# File: .bashrc
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim

Lastly, I create ~/.bash_profile, and put these lines.
Code:

# .bash_profile
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

For autostart scim in xfce, I create an autostart file called startscim and put it into $HOME/Desktop/Autostart.
Code:

#!/bin/sh
# File: ~/Desktop/Autostart/startscim
# Auto start scim from XFCE

scim -d

Make it executable
Code:

chomd +x ~/Desktop/Autostart/startscim
Then restart X, you will be able to trigger Chinese input with Ctrl+space in the following applications.
1. In Firefox when the cursor is in the address bar.
2. In Google when the cursor is in the search box.
3. when the cursor is in the any other input box.
4. In editors such as gedit, kate, kedit.

However, in many KDE applications, some of the Chinese characteres are not viewed correctly, they are displayed as 'dot' or 'box'. My experience is change the font from KDE control center to 'sans serif'.

IMO, Gnome has better Chinese support than KDE.

Hope this helps.

lchxr

satimis 02-21-2007 01:50 AM

Hi lchxr,

Quote:

How do you start kedit, from command line in xterm or from xfce desktop menu?
Tried both
1) On xterm/Terminal
2) On Xfce4 desktop


Performed following steps as root
(Still fail unable to start Chinese enditing. [Ctrl]+[Space] without effect.)

# nano /etc/profile.d/lang.sh
copied "LANG=en_US.UTF-8" on it

Remark: this is not an empty file already having following line on it;
export LC_COLLATE=C


# nano ~/.bashrc
copied following lines on it
Code:

export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim


# nano ~/.bash_profile
copied following lines on it
Code:

# .bash_profile
if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi


# nano $HOME/Desktop/startscim
copied following lines on it
Code:

#!/bin/sh
# File: ~/Desktop/startscim
# Auto start scim from XFCE

scim -d


# chmod +x ~/Desktop/startscim


Restarted X

1)
Started Terminal and then kedit
Pressed [Ctrl]+[Space] without effect

2)
Started kedit on Xfce4 desktop
Pressed [Ctrl]+[Space] also without effect


Quote:

However, in many KDE applications, some of the Chinese characteres are not viewed correctly, they are displayed as 'dot' or 'box'. My experience is change the font from KDE control center to 'sans serif'.

IMO, Gnome has better Chinese support than KDE.
Noted with tks. I'm running Xfce4 desktop


I did it before "adding Chinese editing" on Xfce4 running Ubuntu as OS. It needed;
scim-gtk2-immodules
scim-modules-socket
scim-tables-zh

To edit Chinese,
started Terminal --> Right click --> select "Chinese Input" --> on Terminal evoke kedit/OOOfice/etc.

B.R.
satimis


All times are GMT -5. The time now is 12:36 PM.