You are not logged in.

#1 2007-04-08 10:10:22

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Chinese input in KDE [Solved]

Hi. I've been trying to get scim to work in my KDE desktop to no avail, even after following instructions on the web. I've installed scim, scim-pinyin, scim-tables and skim. They seem to work in GTK applications such as Grsync, but not in any of the KDE applications. I cannot enter Chinese character in Firefox or Openoffice either.

Here is my .xinitrc file

#!/bin/sh

#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#

exec wmaker
#exec startkde
# exec icewm
# exec blackbox
# exec fluxbox

export XIM="SCIM"
export XMODIFIERS=@im=SCIM  
export GTK_IM_MODULE=scim  
export QT_IM_MODULE=scim   
export XIM_PROGRAM="scim -d" 
scim -f socket -c socket -d

I start kdm as a daemon to login, btw.

Can somebody pls tell me what I've done wrong? I'm getting desperate. sad

Last edited by ngch (2007-05-02 12:02:54)

Offline

#2 2007-04-08 10:42:27

dtjohnst
Member
Registered: 2007-03-01
Posts: 85

Re: Chinese input in KDE [Solved]

This may or may not help....but I've had problems getting things to run in the past with sh scripts. Try changing the first line from "#!/bin/sh" to "#!/bin/bash" or whatever you're using as a shell.

Offline

#3 2007-04-09 07:46:30

EricNeon
Member
From: Shanghai,China
Registered: 2006-02-08
Posts: 13
Website

Re: Chinese input in KDE [Solved]

add set in your ~/.xprofile 。 heh
just like this:

#more ~/.xprofile

export LANG="zh_CN.utf8"
export XMODIFIERS="@im=scim"
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
export LC_CTYPE="zh_CN.utf8"
export XIM_PRGRAM="scim"
scim -d


The highest sounds are the hardest to hear. Going forward is a way to retreat. Greater talent shows itself late in life.

http://www.gnome-cn.org
http://www.dolpin.cn

Offline

#4 2007-04-09 09:57:25

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

No dice, both doesn't work. Thx anyway.

Offline

#5 2007-04-09 15:08:51

Manifold
Member
Registered: 2006-08-16
Posts: 64

Re: Chinese input in KDE [Solved]

Have you had a look at the official SCIM website (www.scim-im.org)?

This might help you from their wiki: http://www.scim-im.org/wiki/faq/kde_qt/ … plications

Offline

#6 2007-04-14 15:18:29

circleback
Member
Registered: 2007-04-14
Posts: 49

Re: Chinese input in KDE [Solved]

Has anyone figured out a solution to this problem. I also would love to use this distro but I must have Chinese input support.

Offline

#7 2007-04-15 09:36:08

bsdson.tw
Member
From: Taiwan
Registered: 2005-05-06
Posts: 161

Re: Chinese input in KDE [Solved]

The reason why your SCIM doesn't work in your original post is because
you activate SCIM AFTER you finish your windows manager...

BTW, I am not sure if KDM will invoke .xinitrc?
(because you said your desktop environment is "KDE", but in your .xinitrc, it is wmaker)
try to login into console, and use "startx" to get into desktop environment

or you may...
get into desktop environment,
start a terminal
start scim manually in the terminal (with option "-d")
and then... start firefox in the terminal
check it out.

smile good luck

Offline

#8 2007-04-23 11:55:11

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

I think I figured out the problem. I have to set my locale in /etc/rc.conf to "zh_CN.utf8", and rebooted. This works even though I login with kdm, so the issue is not likely to be with kdm.

After which the shortcut keys to activate it works like a charm. Unfortunately, many programs like Firefox will end up displaying Chinese characters, while the rest of the DE remains in English. Worse still, Openoffice's menus became a bundle of gibberish. I don't like it that way!

Any thing I can do to solve this? I like all my programs to be in English for consistency sake, cos my Chinese isn't that fantastic. :-p

Last edited by ngch (2007-04-23 12:04:12)

Offline

#9 2007-04-23 15:29:56

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Chinese input in KDE [Solved]

Make a file named xinput.sh (or you prefer) under /etc/profile.d/ with following content, then chmod +x so it will be automatically executed everytime system starts up.

export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

I think the problem you have is not related to locale, since SCIM support all UTF-8. Instead it's because SCIM doesn't get any IM setting if you start X through KDM. Anything changed I don't know makes your setting in .xinitrc is not executed.

Offline

#10 2007-04-24 14:04:40

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

Okay, I think I finally hit something. I uninstalled scim and skim, reset my ~/.xinitrc file and removed all other changes to my settings I had done to try to set up skim. The locale is set to "en_SG.utf8".

Then, I reinstalled scim, scim-pinyin and skim. I then created the xinput.sh file mentioned in the previous post by 'ganlu', and then restarted my computer.

After that, I actually can input Chinese into Firefox, grsync and other gtk applications with no problem. KDE applications, Opera and Openoffice still only accept English input though.

Another thing I have discovered; it seems like KDE 3.5 and QT3 applications in Arch are NOT able to work with scim. It says so on this old news page (http://www.archlinux.org/news/166/)

"Note that the QT (scim) support will be in QT4 and is not yet available."

Bummer. Is this the end of the road for my quest enable Chinese input in Arch KDE?

Offline

#11 2007-04-25 06:23:06

bsdson.tw
Member
From: Taiwan
Registered: 2005-05-06
Posts: 161

Re: Chinese input in KDE [Solved]

First, I don't use KDE as my desktop environment, but I think that doesn't matter.
I don't know what's wrong with your configuration, but with mine, I can input traditional chinese in Firefox, Openoffice and Opera.
So I just give you my configuration, and see if it helps.

/etc/rc.conf (partial)

LOCALE="zh_TW.utf8"

/etc/locale.gen
(which means that you could get the locale by commanding "locale -a"
ps. you need to generate locale manually*)

en_US.UTF-8    UTF-8
zh_TW.UTF-8    UTF-8

and I boot my system to level 5 and use XDM which will execute "~/.xsession"
and "~/.xsession" will just execute "~/.xinitrc"
(because "startx" will also execute "~/.xinitrc", I put my configuration mainly in "~/.xinitrc")
~/.xinitrc

#!/bin/sh

echo "Executing ~/.xinitrc..."

export XIM="SCIM"
export XMODIFIERS="@im=SCIM"
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim
export XIM_PROGRAM="scim -d"

export GDK_USE_XFT=1
export QT_XFT=true

export BROWSER="/opt/mozilla/bin/firefox"
export TERMCMD="/opt/xfce4/bin/terminal"

#scim -f socket -c socket -d
scim -d

exec startxfce4

and that is all.

Last edited by bsdson.tw (2007-04-25 06:24:43)

Offline

#12 2007-04-25 11:54:24

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Chinese input in KDE [Solved]

Another thing I have discovered; it seems like KDE 3.5 and QT3 applications in Arch are NOT able to work with scim. It says so on this old news page (http://www.archlinux.org/news/166/). It says so on this old news page (http://www.archlinux.org/news/166/)

Can skim help? Or try to set your environment as XIM instead of "export QT_IM_MODULE="scim"", which means you have to add "export XMODIFIERS="@im=SCIM" in your xinput.sh.

Offline

#13 2007-04-25 11:56:16

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Chinese input in KDE [Solved]

Or fcitx?

Offline

#14 2007-04-26 02:51:53

once
Member
From: Taiwan
Registered: 2006-09-12
Posts: 270

Re: Chinese input in KDE [Solved]

im using gcin & kde, and everything doing ok.

export XMODIFIERS=@im=gcin
export LC_LANG=zh_TW.utf-8
export QT_IM_MODULES=gcin
gcin &

Offline

#15 2007-04-26 13:03:02

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

I installed skim, doesn't make a difference.

Changing the locale to "zh_TW.utf-8" does not help, only turns Firefox chinese-only and openoffice to complete gibberish.

So far, this is the content of my ~/.xprofile:

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -f socket -c socket -d

Tried using uim, turns out that it can only work with scim, bringing me back to square one again.

Then again, I am quite happy to get scim to work with Firefox though.

I haven't try all the solutions suggested though, so I'm still hanging on...

Offline

#16 2007-04-27 18:36:32

circleback
Member
Registered: 2007-04-14
Posts: 49

Re: Chinese input in KDE [Solved]

I tried Ganlu's method and it mostly works in Gnome. However, it somehow prevents Openoffice from starting.


ganlu wrote:

Make a file named xinput.sh (or you prefer) under /etc/profile.d/ with following content, then chmod +x so it will be automatically executed everytime system starts up.

export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

I think the problem you have is not related to locale, since SCIM support all UTF-8. Instead it's because SCIM doesn't get any IM setting if you start X through KDM. Anything changed I don't know makes your setting in .xinitrc is not executed.

Offline

#17 2007-04-28 03:43:15

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

I hit another thing; changing the locale to zh_**.utf8 DOES allow me to enter Chinese in KDE applications, but also messes up the interface of some programs like Openoffice.

Offline

#18 2007-04-28 10:18:51

ganlu
Member
From: ChongQing, China
Registered: 2004-01-04
Posts: 360

Re: Chinese input in KDE [Solved]

Since devs have decided not to apply qtimm patch to official QT package, so to use SCIM with KDE apps, the current way is to use the XIM method and set QT_IM_MODULE to xim, you lost some SCIM features of course, but I think it will work.

export XMODIFIERS=@im=SCIM
export QT_IM_MODULE=xim

Good luck.

Offline

#19 2007-04-29 03:59:32

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

BINGO! I finally managed to enter Chinese characters in ALL my programs. Yeeha! lol

Thanks everyone for all your help and patience! Without all your help, I'll probably be stuck typing Chinese in XP. tongue

These are all the steps I have taken:

1. Install "scim", "scim-pinyin" (pinyin input) and "skim"
2. Create .xprofile in my home folder (~/.xprofile) with the following text

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
scim -f socket -c socket -d

3. Set SKIM to start automatically at login
4. Log out, Cltrl-Alt-Del and login again

This works if I login with kdm. Changing the locale does not seem necessary as it works with my locale set to "en_US.utf8"

Once again, thanks guys!

Last edited by ngch (2007-05-05 07:43:08)

Offline

#20 2007-04-29 12:06:45

circleback
Member
Registered: 2007-04-14
Posts: 49

Re: Chinese input in KDE [Solved]

Does this method also work while using OpenOffice?

Offline

#21 2007-04-29 14:36:25

ngch
Member
From: Singapore
Registered: 2007-03-17
Posts: 12

Re: Chinese input in KDE [Solved]

yes, at least on my arch installation.

Offline

#22 2007-05-26 00:01:45

Si
Member
Registered: 2006-09-11
Posts: 57

Re: Chinese input in KDE [Solved]

I think some people had problems calling the input method in KDE because Qt in Arch doesn't include qt-immodule. I applied the immodule patch and to gcin as well, then I can set QT_IM_MODULE=gcin without problem now.

My PKGBUILD:

pkgname=qt
pkgver=3.3.8
pkgrel=3
pkgdesc="The QT gui toolkit."
arch=(i686 x86_64)
url="http://www.trolltech.com/products/qt/index.html"
pkgfqn=${pkgname}-x11-free-${pkgver}
install=qt.install
depends=('libpng' 'libjpeg' 'libxmu' 'libxcursor' 'libxinerama' 'mesa' \
     'libxft' 'libxrandr')
makedepends=('mysql' 'postgresql>=8.2.3' 'sqlite3' 'unixodbc' 'libmng')
source=(ftp://ftp.trolltech.com/qt/source/${pkgfqn}.tar.gz qt.profile \
        qt-copy-kde-patches.tar.bz2 qt-patches.tar.bz2 utf8-bug-qt3.diff \
        qt-font-default-subst.diff \
        qt-x11-immodule-unified-qt3.3.8-20070321-gentoo.diff.bz2 \
        qt-add-bold-style-for-missing-font.patch.gz)

# qt-copy-kde-patches come from http://websvn.kde.org/trunk/qt-copy/patches/
# other qt-patches come from fedora and gentoo

build() {
  export QTDIR=$startdir/src/$pkgfqn
  export PATH=${QTDIR}/bin:${PATH}
  export LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}
  cd $startdir/src/$pkgfqn
  # apply qt patches from kde.org
  for i in ../qt-copy-kde-patches/*; do
    patch -Np0 -i $i || return 1
  done
  # apply other qt patches and one security fix from debian/gentoo
  for i in ../qt-patches/*; do
    patch -Np1 -i $i || return 1
  done
  # fix utf8 bug
  patch -Np0 -i ../utf8-bug-qt3.diff || return 1
  # fix asia fonts
  patch -Np0 -i ../qt-font-default-subst.diff || return 1
  # apply immodule patch
  patch -Np1 -i ../qt-x11-immodule-unified-qt3.3.8-20070321-gentoo.diff
  # add bold style for fonts missing it
  patch -Np1 -i ../qt-add-bold-style-for-missing-font.patch

  # start compiling qt
  sed -i 's|-cp -P -f|-cp -L -f|' qmake/Makefile.unix
  rm -rf doc/html examples tutorial
  sed -i "s|sub-tutorial sub-examples||" Makefile
  sed -i "s|-O2|$CXXFLAGS|" mkspecs/linux-g++/qmake.conf
  sed -i "s|-I. |$CXXFLAGS -I. |" qmake/Makefile.unix
  sed -i "s|read acceptance|acceptance=yes|" configure

  if [ "$CARCH" = "x86_64" ]; then
      export ARCH="-64"    
    else unset ARCH
  fi

  sh make-symlinks.sh
  ./configure -prefix /opt/qt -platform linux-g++$ARCH \
    -system-zlib -qt-gif -release -shared -sm -nis -thread -stl \
    -{system-lib,plugin-imgfmt-}{png,jpeg,mng} \
    -no-g++-exceptions -plugin-sql-{mysql,psql,sqlite,odbc}

  # fix /opt/qt/lib path
  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/src/Makefile
  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/designer/Makefile
  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/editor/Makefile
  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/assistant/lib/Makefile
  [ "$CARCH" = "x86_64" ] && sed -i "s|/opt/qt/lib64|/opt/qt/lib|g" $startdir/src/$pkgfqn/tools/designer/uilib/Makefile

  cd $startdir/src/$pkgfqn
  make -C qmake || return 1
  cd $startdir/src/$pkgfqn/plugins/src/sqldrivers/mysql
  $startdir/src/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/include/mysql" "LIBS+=-L/usr/lib/mysql -lmysqlclient" mysql.pro
  cd $startdir/src/$pkgfqn/plugins/src/sqldrivers/psql
  $startdir/src/$pkgfqn/bin/qmake -o Makefile "INCPATH+=/usr/src/include /usr/include/postgresql/server" "LIBS+=-L/usr/lib -lpq" psql.pro

  cd $startdir/src/$pkgfqn
  # fix the broken makefiles
  #sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile
  make || return 1
  make INSTALL_ROOT=$startdir/pkg install
  rm -rf `find $startdir/pkg/opt/qt/mkspecs/* | grep -v linux-g++$ARCH`
  rm -rf $startdir/pkg/opt/qt/{phrasebooks,templates,translations}
  sed -i "s|-L$startdir/src/$pkgfqn/lib ||g" $startdir/pkg/opt/qt/lib/*.prl
  install -D -m755 qmake/qmake $startdir/pkg/opt/qt/bin/qmake
  install -D -m755 $startdir/qt.profile $startdir/pkg/etc/profile.d/qt.sh
  [ "$CARCH" = "x86_64" ] && sed -i "s|linux-g++|linux-g++-64|g" $startdir/pkg/etc/profile.d/qt.sh

  rm -f $startdir/pkg/opt/qt/mkspecs/linux-g++$ARCH/linux-g++$ARCH
  # install man pages
  mkdir -p $startdir/pkg/opt/qt/man
  cp -r $startdir/src/$pkgfqn/doc/man/{man1,man3} $startdir/pkg/opt/qt/man/
  #libtoolslay
  find $startdir/pkg -name '*.la' -exec rm {} \;

  # Arch64 fix
  if [ "$CARCH" = "x86_64" ]; then
    mkdir $startdir/pkg/opt/qt/mkspecs/linux-g++
    cd  $startdir/pkg/opt/qt/mkspecs/linux-g++
    ln -s -v ../linux-g++-64/* .
  fi
}

Offline

#23 2007-05-26 08:56:12

sweiss
Member
Registered: 2004-02-16
Posts: 635

Re: Chinese input in KDE [Solved]

If I recall correctly, there was a release of Qt with the qt-immodule included, but it was quickly removed because it broke binary compatibility.

Offline

#24 2007-10-13 09:36:15

idjut
Member
From: Oslo
Registered: 2006-05-15
Posts: 177

Re: Chinese input in KDE [Solved]

ngch wrote:

These are all the steps I have taken:

1. Install "scim", "scim-pinyin" (pinyin input) and "skim"
2. Create .xprofile in my home folder (~/.xprofile) with the following text

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
scim -f socket -c socket -d

3. Set SKIM to start automatically at login
4. Log out, Cltrl-Alt-Del and login again

This works if I login with kdm. Changing the locale does not seem necessary as it works with my locale set to "en_US.utf8"

Once again, thanks guys!

Anyone else still have problems with this? I put the above in .xinitrc and scim doesnt work at all. If I replace xim with scim it works for gtk but not qt. I have qt4 4.3.2-1 and qt-enhanced 3.3.8-13. I do not use kdm or kde


Linux user #403491

"Men have called me mad; but the question is not yet settled, whether madness is or is not the loftiest intelligence– whether much that is glorious– whether all that is profound– does not spring from disease of thought– from moods of mind exalted at the expense of the general intellect." - E. A. Poe from Eleonora

Offline

#25 2007-10-13 17:04:24

goether
Member
Registered: 2007-04-27
Posts: 8

Re: Chinese input in KDE [Solved]

I have just solved my problem of Korean input under KDE yesterday. I'm pretty sure it'll work for Chinese input.
Instead of having the export in .x*, i put:

export XMODIFIERS=@im=SCIM
export LC_CTYPE="ko_KR.UTF-8"
export GTK_IM_MODULE=scim
export QT_IM_MODULE=scim

into .bashrc
I have qt 3.3.8-5, qt4 4.3.2-1, scim, scim-hangul, skim installed. and my locale is set to en_US.utf8.

Good luck!

Offline

Board footer

Powered by FluxBB