Typing Chinese in Ubuntu

If you are using a Chinese session, then you should be able to use SCIM to input Chinese straight out of the box.You can install the Chinese language support by going to System, Administration, Language Support.

However, if you are not using a CJK session, then there is a little tweaking you need to do. First, you must install some SCIM packages. Open a new terminal and install the scim-bridge and any input methods you wish to use. e.g.

sudo apt-get install scim-bridge scim-pinyin scim-tables-zh

If you would like to be able to input in KDE programs as well, then also install scim-bridge-client-qt

sudo apt-get install scim-bridge-client-qt

Next, you need to edit the file /etc/X11/xinit/xinput.d/scim and change the GT module to use scim-bridge instead of xim. To do this, open the above file, in the terminal, run

gksudo gedit /etc/X11/xinit/xinput.d/scim

Now, change the line
GTK_IM_MODULE=xim
to
GTK_IM_MODULE=scim-bridge

Then, if you would like input in KDE programs as well, then change the following line too
QT_IM_MODULE=xim
to
QT_IM_MODULE=scim-bridge

Save the file and close the text editor.

For the input methods, I usually use the Changjie3 and Quick, and disable the others. (The reason I don't use Changjie5 is because there are some chinese words that you need to input differently than previous versions of Changjie e.g. for the word ? - traditionally, you will type ??? [OHS], but with Changjie 5, it is ??? [OOS] - which probably is more correct based on the logic of Changjie). Anyways, to do this, go to System > Preferences > SCIM Input Method Setup

Now, on the left panel, select IMEngine > Global Setup.

On the right panel, uncheck Chinese (simplified)

Expand the Chinese (traditional)

And uncheck all except Changjie 3 and Quick

Then press Apply and Quit. Then logout of the session and log back in. Now you should be able to type
in Chinese by pressing Ctrl-Space to toggle between English and Chinese.