Jump to content

Getting SCIM running for Chinese input in Mdk 9.1


Jiawen
 Share

Recommended Posts

I'd like help getting SCIM to run as my Chinese input server in Mandrake 9.1.

 

I installed Mandrake 9.1 with Chinese/Traditional (Taiwan) locale last year, and have been using XCIN for my Chinese input since then. XCIN is somewhat crash-prone, though, and doesn't have intelligent Pinyin (where the input system can guess what you're trying to type), so I have had my heart set on SCIM for a while.

 

I tried installing it from RPMs and was somewhat successful. As stated in various pages around the web, I changed lines in /etc/sysconfig/i18n, /etc/X11/xinit/xinitrc and /etc/X11/xinit/XIM. Mostly, I changed all the instances of "XCIN" to read "SCIM".

 

I got SCIM working a little -- it worked in OpenOffice.org, but not in anything else -- and then, since I recently re-logged in, it has refused to open at all. The status icon (a little keyboard) shows up correctly, and I can right-click it to change the setup, but left-clicking on it and hitting strl+space to go into Chinese mode both do nothing.

 

So... does anyone have experience getting SCIM to run on Mandrake? What steps do I need to go through? I'm sure I've missed something important along the way, but I don't know what.

Link to comment
Share on other sites

Thank you for the reply! The thread you linked to, and your comments there, were pretty helpful. Unfortunately, SCIM is still not working. Maybe I need to explain what I've done so far...

 

I first uninstalled the 0.8.2 RPM, then downloaded and installed the 0.9.0 one. I copied the details you gave into my home/me/.i18n file, and I even tried setting localedrake to something else and then back to Taiwanese/traditional. I didn't do the Cangjie part, though -- I don't want that input method. I also didn't touch the KDE parts -- I'm using Gnome, so I don't need to do that, right? Do I need to do that if I'm using Quanta from within Gnome?

 

Are there other files that I need to change? I noticed that you only said to write SCIM in the last line -- does it need to be in caps in other lines? What about other files?

 

Also, for what it's worth, when I try scim -restart, I get the following:

Smart Common Input Method 0.9.0

Loading simple Config module ...
Creating backend ...
Loading Server module: pinyin ...
   Loading Server Factory 0 ... : OK
pinyin Server module is successfully loaded.
Loading Server module: rawcode ...
   Loading Server Factory 0 ... : OK
rawcode Server module is successfully loaded.
Loading Server module: table ...
   Loading Server Factory 0 ... : OK
   Loading Server Factory 1 ... : OK
   Loading Server Factory 2 ... : OK
   Loading Server Factory 3 ... : OK
   Loading Server Factory 4 ... : OK
   Loading Server Factory 5 ... : OK
   Loading Server Factory 6 ... : OK
table Server module is successfully loaded.
Loading x11 FrontEnd module ...
Starting SCIM ...

Then it just sits there and never returns me to the prompt.

 

What else should I do?

 

Thanks again for the help!

Edited by Jiawen
Link to comment
Share on other sites

With the modified ~/.i18n, SCIM should start when you re-login your account.

 

If not, try:

 

$ export LC_ALL=zh_TW.UTF-8

$ export XMODIFIERS=@im=SCIM

$ export GTK_IM_MODULE=xim

$ scim -d

 

From then, every XIM-compliant program launched thru command line in that terminal will be able to use SCIM; however, it is limited to that terminal environment.

 

That's why I would suggest modifying ~/.i18n, after re-login again it should do the trick.

Link to comment
Share on other sites

I first uninstalled the 0.8.2 RPM, then downloaded and installed the 0.9.0 one.  I copied the details you gave into my home/me/.i18n file, and I even tried setting localedrake to something else and then back to Taiwanese/traditional.

Make sure you run localedrake BEFORE modifying ~/.i18n

 

Are there other files that I need to change?  I noticed that you only said to write SCIM in the last line -- does it need to be in caps in other lines?  What about other files?

In my experience, there is no need to be CAPS in other lines.

Edited by zero0w
Link to comment
Share on other sites

Okay, this is really strange...

 

I tried rebooting, re-logging in, re-editing all the files I referred to... Nothing seemed to be working, and I was seriously considering getting rid of SCIM in favor of XCIN again. I tried "scim" in a terminal... It again gives me the same message and then just sits there.

 

However, I again tried clicking on the little SCIM keyboard icon, and suddenly got a ghost of the input type chooser. I clicked again, and lo and behold, the chooser came up. 突然間, 我可以疏入中文了!好奇怪!

 

I guess I must've finally edited the right line the right way. I have no idea which one it was, though. It's kind of frustrating. But I won't complain too loud. :)

 

A possibly related problem: every time I restart Gnome, now, OpenOffice.org comes up automatically. Did I miswrite something?

 

Another possibly related thing: about a half hour ago, I was having problems saving things. I checked KDiskFree, which said I had 0 space left on my Home partition. I scoured around trying to find what was taking up so much space -- it was my .xsession-errors file, which was at 450 MB and growing. I copied it to a different partition, shut down X, deleted .xsession-errors, then restarted everything. The system seems much happier now. Could that be part of why SCIM suddenly started working?

 

Oh, and I don't think I needed to change the locale, since I was originally using Taiwan/Traditional Chinese anyway. I didn't, did I?

 

Thanks again for all the help. Now I just need to figure out why OpenOffice.org is opening all by itself. :)

Link to comment
Share on other sites

You can delete the .xsession-errors if you wish. It is just an error log file.

 

Also, try to close OpenOffice.org, then logout/re-login again, the autostart of OpenOffice.org should go away, and do not shutdown/reboot your system without closing it.

 

And if you try to use scim at console, you must add the -d option so that it is running as a daemon service, see my previous post for more detail.

Edited by zero0w
Link to comment
Share on other sites

Thanks again for the very helpful reply! 好像中文沒問題了, 但是我還想問, SCIM 有沒有辦法使用聲調? 它的智能拼音還沒那么聰明, 我想教快一點。 聲調怎么疏入?How do you input tones in SCIM? I want to get the input a bit faster until the Intelligent Pinyin learns more common phrases.

 

Also, do I have to keep the terminal window open? Is there a way to make SCIM start up automatically when I start X/Gnome?

 

Finally, about OpenOffice.org -- I tried shutting it down, and also killing all the related processes before re-logging in. They didn't make any difference -- OO.o still started automatically at next Gnome startup, and still crashes when I try to save anything. But perhaps I should put that on a separate thread...?

 

Thanks again for any additional help you can give.

Link to comment
Share on other sites

I will definitely check out the LinuxSir forum. It looks great! Thanks for the tip.

 

As for the .i18n thing, I thought I had already done that. I copied what you posted on that other forum into my .i18n file, so why isn't it starting SCIM at login?

 

Just to be sure, "~/.i18n" means .i18n in my home directory, right? /home/me/.i18n, right?

 

Thanks again for all the help!

Link to comment
Share on other sites

> Just to be sure, "~/.i18n" means .i18n in my home directory, right? /home/me/.i18n, right?

 

Yes, ~/.i18n = /home/username/.i18n

 

and modify the file like this:

 

LANGUAGE=zh_TW.UTF-8:zh_TW:zh_HK:zh
LANG=zh_TW.UTF-8
LC_ADDRESS=zh_TW.UTF-8
LC_COLLATE=zh_TW.UTF-8
LC_NAME=zh_TW.UTF-8
LC_NUMERIC=zh_TW.UTF-8
LC_TIME=zh_TW.UTF-8
LC_MEASUREMENT=zh_TW.UTF-8
LC_MESSAGES=zh_TW.UTF-8
LC_IDENTIFICATION=zh_TW.UTF-8
LC_CTYPE=zh_TW.UTF-8
LC_TELEPHONE=zh_TW.UTF-8
LC_MONETARY=zh_TW.UTF-8
LC_PAPER=zh_TW.UTF-8
CONSOLE_NOT_LOCALIZED=yes
ENC=utf8
XIM_PROGRAM=scim
XIM=scim
GTK_IM_MODULE=xim
XMODIFIERS="@im=SCIM"

 

Though I am using KDE, there is a chance you may need to install this package:

 

scim-gtk2-immodule-0.9.0-1.i586.rpm

 

and change some configurations to make SCIM work with Gnome, but I am not sure about that. SCIM official site would have more info.

Edited by zero0w
Link to comment
Share on other sites

Are you still reading this, zero0w? I hope so... :)

 

I copied exactly what you wrote into my .i18n file, but no luck. Here's what's going on.

 

I was having massive problems with OpenOffice.org, as I noted. (Not being able to save anything counts as a massive problem in my book.) I asked around lots of places, including this forum, but got no replies. I still haven't tried LinuxSir.org, but I will soon.

 

I decided to uninstall OO.o and reinstall it again. Perhaps that would stop the problems...? Well, it didn't. OO.o was still opening upon login and crashing when I tried to save anything. (Although, strangely, I found out I could save to .doc format, just not .sxw.)

 

I thought perhaps it was a problem with my OO.o profiles, so I deleted .openoffice in my home directory. I was right -- when I reinstalled OO.o again, it saved as .sxw with no problem. (Of course, I had to re-edit the interface, but that's a minor problem.)

 

Why am I still posting this on this thread? Because I'm convinced that my OpenOffice problems are related to installing SCIM. First, the saving problem appeared when I installed SCIM. Second, when I installed OpenOffice.org from RPM's, Mandrake told me I needed to install the mainland Chinese localization modules, not the Taiwanese ones. In other words, somewhere along the line, my system is set for zh_CN, not zh_TW. I can't figure out where, though.

 

Also, now when I start up SCIM, the terminal goes through the startup routine, then gives me

scim::FrontEnd: X11 -- failed to connect to the panel daemon!

Then the SCIM icon comes up but doesn't allow me to go into non-English mode. I can right-click the icon, but left-clicking does nothing.

 

Any idea what's going on? I'll try LinuxSir, but you've been so helpful, I hoped you might have an idea here.

 

Thanks again for all your help.

Link to comment
Share on other sites

I've tried a couple other things since that last post. Nothing's working right, still.

 

I checked LinuxSir.org and found several mentions of OO and SCIM, but nothing helped. I also saw a lot of problems with SCIM. Perhaps SCIM isn't ready for real-life use? Also, LinuxSir's search function didn't seem to be working, so I couldn't find all the mentions of OO.

 

I decided to reinstall XCIN. At least it was working in OpenOffice, before. So I uninstalled the SCIM RPMs and reinstalled the XCIN ones. I changed all the configuration files back. Or at least I thought I did -- XCIN doesn't work now. I have no Chinese input at all. :( Here's how they read now:

 

/etc/sysconfig/i18n:

 

LANGUAGE=zh_TW.Big5:zh_TW:zh_HK:zh
LC_ADDRESS=zh_TW
LC_COLLATE=zh_TW
LC_NAME=zh_TW
XIM=XCIN
LC_NUMERIC=zh_TW
LC_TIME=zh_TW
LC_MEASUREMENT=zh_TW
LANG=zh_TW
LC_MESSAGES=zh_TW
LC_IDENTIFICATION=zh_TW
LC_CTYPE=zh_TW
LC_TELEPHONE=zh_TW
CONSOLE_NOT_LOCALIZED=yes
ENC=big5
LC_MONETARY=zh_TW
XIM_PROGRAM=XCIN
LC_PAPER=zh_TW
XMODIFIERS="@im=XCIN-zh_TW"

 

/etc/X11/xinit/xinitrc:

 

#!/bin/sh
# (c) 2000-2002 MandrakeSoft
# $Id: xinitrc-xinitrc,v 1.2 2002/09/10 05:53:43 flepied Exp $

# Set a background here because it's not done anymore
# in Xsesion for non root users
if [ "`whoami`" != root ]; then
   xsetroot -solid "#21449C"
fi

exec /etc/X11/Xsession $*

xcin -d

export XMODIFIERS=@im=XCIN-zh_TW

 

/etc/X11/xinit/XIM:

 

#!/bin/bash

# read the user (~/.i18n) or system-wide (/etc/sysconfig/i18n) i18n settings
. /etc/profile.d/10lang.sh

# The Gnome applets must not be launched each time if they are already
# managed by Gnome; here is the file path to the Gnome Applets config file;
# so we can do a grep to see if a given applet is already managed by Gnome
GNOME_APPLET_CONFIG="$HOME/.gnome/panel.d/default/Applet_Config"

if [ -z "$XIM_PROGRAM" -a -z "$XIM" ]; then
  locale=C
  if [ ! -z "$LC_ALL" ]; then
locale=$LC_ALL
  elif [ ! -z "$LC_CTYPE" ]; then
locale=$LC_CTYPE
  elif [ ! -z "$LANG" ]; then
locale=$LANG
  fi
  case $locale in
   zh_TW*)
export LC_CTYPE=zh_TW.Big5
XIM=XCIN
;;
   zh_CN*)
XIM=Chinput
;;
   ja*)
XIM=kinput2
;;
   ko*)
XIM=Ami
;;
   *)
XIM=none
;;
  esac
fi
if [ -z "$XIM_PROGRAM" ]; then
  case "$XIM" in
   Chinput) XIM_PROGRAM=chinput;;
   scim*) XIM_PROGRAM=scim;;
   xcin) XIM_PROGRAM=xcin;;
   kinput2) XIM_PROGRAM=kinput2;;
   Ami)
  	 # now ami determine which mode it will take from $DESKTOP variable
# (not from this script's first argument given by Xsession script)
# i think this way seems better.
# -- Jaegeum --
case $DESKTOP in
# Gnome init program automatically restore previous session's
# ami_applet. If you put ami_applet here, you may experience a lot of
# repeated error windows that report "an applet died abruptly".
# so we first check if the ami_applet is referenced in Gnome config
# files

# I think removing ` and ` around grep command is more reasonable.
# -- Jaegeum --
Gnome|GNOME|gnome)
    if [ -f "$GNOME_APPLET_CONFIG" ] && \
 grep -q '\<ami_applet\>' "$GNOME_APPLET_CONFIG";
    then
 XIM_PROGRAM=/bin/true
    elif [ -x /usr/bin/ami_applet ]; then
 XIM_PROGRAM=ami_applet
    else
 XIM_PROGRAM=ami
    fi;;
# Now new wmami supports KDE2 docking mode.
# XIM_PROG_ARGS variable is added to send xim's arguments if 
# they are needed. 
# -- Jaegeum --
KDE|Kde|kde)
	 XIM_PROGRAM=wmami 
	 XIM_PROG_ARGS="-wait";;
WindowMaker|WINDOWMAKER|Windowmaker|windowmaker)
	 XIM_PROGRAM=wmami
	 XIM_PROG_ARGS="-wait";;
# Following three WM entries should be added 
# because that wmami supports them is already well known fact.
# -- Jaegeum --
AfterStep|AFTERSTEP|Afterstep|afterstep)
	 XIM_PROGRAM=wmami
	 XIM_PROG_ARGS="-wait";;
Enlightenment|ENLIGHTENMENT|enlightenment)
	 XIM_PROGRAM=wmami
	 XIM_PROG_ARGS="-wait";;
BlackBox|BLACKBOX|Blackbox|blackbox)
	 XIM_PROGRAM=wmami
	 XIM_PROG_ARGS="-wait";;
*)
	 XIM_PROGRAM=ami;;
esac;;
   *) XIM_PROGRAM=/bin/true;;
  esac
fi
[ -z "$XMODIFIERS" -a -n "$XIM" ] && export XMODIFIERS="@im=$XIM"

if which $XIM_PROGRAM >/dev/null 2>/dev/null
then
$XIM_PROGRAM $XIM_PROG_ARGS &
fi

 

~/.xinitrc:

#!/bin/sh
# (c) 2000-2002 MandrakeSoft
# $Id: xinitrc-xinitrc,v 1.2 2002/09/10 05:53:43 flepied Exp $

# Set a background here because it's not done anymore
# in Xsesion for non root users
if [ "`whoami`" != root ]; then
   xsetroot -solid "#21449C"
fi

exec /etc/X11/Xsession $*

XCIN -d

export XMODIFIERS=@im=XCIN

 

However, when I logged in again, OpenOffice.org still started up by itself. And, like I said, I have no Chinese input at all now. I'm sure I screwed up one of the configuration files, but I have no idea how or which one.

 

I'd really like to get OpenOffice working normally with SCIM, but I'll settle for XCIN if need be.

 

Please, please help! Thank you!

Link to comment
Share on other sites

First, if you have copied /etc/sysconfig/i18n to your home directory as ~/.i18n , then the system will set the locale according to ~/.i18n instead.

 

Second, there is no need to delete Xcin / SCIM (except for harddrive space reason), these IMEs can co-exist in the same system easily.

 

Finally, there is no need to change any other system file except ~/.i18n. I never touch other system files such as /etc/X11/xinit/xinitrc, /etc/X11/xinit/XIM, ~/.xinitrc at all.

 

I am not sure where your problem stems from, so here is my suggestion:

 

1) For the line: XMODIFIERS="@im=xcin-zh_TW", I will guess xcin must not be in upper case (Caps), it should be in lower case; change the XIM/XIM_PROGRAM lines too if you still find any problem.

 

2) The OpenOffice.org problem is unlikely to be solved without a complete re-install of Mandrake, it's very weird indeed.

 

3) If you decide to re-install, when choosing language, change to the Advanced Option and choose English (American/ British), Traditional Chinese, Simplified Chinese, and other languages you use along side, then the system will have all the locale components needed.

 

4) I recommend copying the file /etc/sysconfig/i18n to ~/.i18n

That way you can change and test your locale setting easily by editting ~/.i18n plus log out/log in.

 

5) I am not sure about this, whether your are using Xcin or SCIM, you may also have to add this line to your /etc/syconfig/i18n or ~/.i18n

 

GTK_IM_MODULE=xim

 

For installing Xcin and its configuration under Mandrake 9.1+, you can check out these discussions at HKLPG BBS:

 

http://bbs.hklpg.org/viewtopic.php?t=5195

http://bbs.hklpg.org/viewtopic.php?t=4664

Edited by zero0w
Link to comment
Share on other sites

I changed everything except .i18n back to the way it was before, and changed my .i18n file back to:

LANGUAGE=zh_TW.Big5:zh_TW:zh_HK:zh
LC_ADDRESS=zh_TW
LC_COLLATE=zh_TW
LC_NAME=zh_TW
XIM=xcin
LC_NUMERIC=zh_TW
LC_TIME=zh_TW
LC_MEASUREMENT=zh_TW
LANG=zh_TW
LC_MESSAGES=zh_TW
LC_IDENTIFICATION=zh_TW
LC_CTYPE=zh_TW
LC_TELEPHONE=zh_TW
CONSOLE_NOT_LOCALIZED=yes
ENC=big5
LC_MONETARY=zh_TW
XIM_PROGRAM=xcin
LC_PAPER=zh_TW
XMODIFIERS="@im=xcin-zh_TW"

 

Xcin is now working pretty normally -- which is to say, somewhat buggily and far from perfect, but workable. I'd still rather get SCIM working.

 

I tried changing only the .i18n file for SCIM, and I installed scim-gtk2-immodule-0.9.0-1.i586.rpm, but I have no idea what this means. James Su says:

How to use the SCIM's GTK2 IMModule within gtk2 application?

 

You should install scim-gtk2-immodule package in order to use the SCIM's GTK2 IMModule. After installation, run command "gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules" to let gtk2 recognizes the new immodule provided by SCIM.

 

Because the gtk2 immodule provided by SCIM will use the Input Method service provided by a scim running with the Socket FrontEnd, you must first start a scim daemon with Socket FrontEnd:

 

scim -f socket -ns socket -d

 

Then you may use the SCIM's gtk2 immodule directly within gtk2 application by choosing "SCIM Input Method" within the Input Method selection menu. Just right click in the input area you will see the menu.

 

Of course you can let the scim running with the X11 FrontEnd uses the same Input Method service provided by the scim running with the Socket FrontEnd. In order to do this, you should use the following commands to start the whole SCIM environment:

 

scim -f socket -ns socket -d

 

scim -f x11 -s socket -c socket -d

 

Since scim-0.6.0, the gtk2 immodule and the x11 frontend will share the same GUI daemon (scim-panel-gtk) to show the user interface. the program scim-panel-gtk will be started automatically by the X11 FrontEnd or the gtk2 immodule. You may not run it manually.

However, I don't understand a lot of that. What is the GTK2 IMModule? Why would I want to run it? How do I start SCIM at login this way? Do I need to get this stuff working to have SCIM work under any Gnome application, or just with specific ones?

 

Part of the problem is that Mr. Su's English is not as good as it could be. A sentence like "Of course you can let the scim running with the X11 FrontEnd uses the same Input Method service provided by the scim running with the Socket FrontEnd" would be complicated if it were only computer instructions, but he also doesn't have a clear main verb. I have very little idea what that sentence means. Unfortunately, the page doesn't have a Chinese version. SCIM is a really cool program, but the documentation is a little lacking. (If I ever get this figured out, I'm going to write up a howto and put it on my page, as well as offer to write more complete documentation for Mr. Su's page.)

 

You mentioned that I may have to add "GTK_IM_MODULE=xim" to my /etc/syconfig/i18n or ~/.i18n. How do I know if I need to add that line to those files? Just experiment, I guess...? What else would I need to change? How would I know what I need to change?

 

I think that's about it for now. I'm sure I'm missing something, but I can't think of what. :)

 

As before, thanks for all the help. You've been amazingly patient with me. And thanks again for any further help you can give.

 

By the way, if you created the Sodipodi images on your website, you also seem to be a great artist. Creating a car from scratch using vectors is... amazing. I've done some messing around in Corel Draw, but not much in Sodipodi. Maybe we'll have to compare notes when I get it running right.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...