Set up Fcitx for Chinese and Japanese language input on Ubuntu Trusty 14.04
After recently upgrading to Ubuntu 14.04 Trusty Tahr (LTS), I decided to give Fcitx, the default input method framework on Ubuntu's Chinese sister project Ubuntu Kylin, a try and I was pleasantly surprised. Not only is Fcitx rock-solid and actively developed, it also offers input methods for Japanese, Korean, Vietnamese and a bunch of other languages in addition to the default Chinese input methods. Here is how you get it to work on Ubuntu 14.04.
- Make sure you remove any IBus input methods you may have been using previously: Go to System Settings –> Text Entry, and remove all entries in the pane below “Input sources to use”, except the one representing your default keyboard layout. Also make sure to remove the keyboard shortcuts for “Switch to next source” and “Switch to previous source” by clicking inside the corresponding boxes on the right and hitting Backspace.
- Install the following packages via Software Center, Synaptic or sudo apt-get install:
fcitx fcitx-pinyin fcitx-sunpinyin fcitx-googlepinyin fcitx-anthy fcitx-mozc
- Use a terminal (Ctrl + Alt + T) or a Run dialogue (Alt + F2) to run:
im-config
When asked if you want to explicitly update the user preferences, select “Yes”, then select fcitx as the default input method framework in the dialogue which pops up. - Log off and back on again, or better yet, reboot.
- You should now see a keyboard icon in your system tray in the upper right corner of your screen. Click the icon and choose “Configure Current Input Method”, which should the Input Method Configuration. Clicking the plus “+” sign in the lower left corner of that window will open a small dialogue window. Uncheck the box “Only Show Current Language” and add the input methods you need (more on that below).
- Close the settings window, open your favourite text editor, bring up your desired input method via the Fcitx tray icon –> Input Method or the keyboard trigger shortcut: Ctrl + Space. You can also use Ctrl + Shift to move to the next input method.
There are a wide variety of options to configure the default behaviour of Fcitx and its looks. I like to preserve the input method state across windows, for example, which can be set under: Fcitx tray icon –> Configure Current Input Method –> Global Config.
Recommended Input Methods
As for input methods, I recommend Sun Pinyin for Chinese, and Mozc (which originates from Google Japanese Input) for Japanese. Both are excellent input methods that work very reliably in everyday use and are at least on par with what you get on Windows or Mac. Unfortunately the version of Sun Pinyin found in the Ubuntu 14.04 repositories suffers from a bug that prevents you from entering “yue” or “qiong”. To get around this, you have to update the package for “sunpinyin-data”, either by compiling it yourself or by getting a more recent version from the Debian repos. If you opt for the latter, run the following in your terminal:
wget http://http.us.debian.org/debian/pool/main/o/open-gram/sunpinyin-data_0.1.22+20131212-1_amd64.deb
Then compare the various checksums against the numbers you find on https://packages.debian.org/jessie/amd64/sunpinyin-data/download:
md5sum sunpinyin-data_0.1.22+20131212-1_amd64.deb
openssl sha1 sunpinyin-data_0.1.22+20131212-1_amd64.deb
sha256sum sunpinyin-data_0.1.22+20131212-1_amd64.deb
If they match, go ahead and install the package via: sudo dpkg -i sunpinyin-data_0.1.22+20131212-1_amd64.deb
Note that if you run a 32-bit system, you would need to get the package sunpinyin-data_0.1.22+20131212-1_i386.deb
instead.