First, you'll have to install the Chinese language related files. See the below screenshot for visual details.
- Press the Super/Windows key.
- Type Language Support and press Enter.
- In the Language tab, click the Install / Remove Languages button.
- In the Installed Languages, select Chinese (simplified) and Chinese (traditional) and click Apply Changes.
The next step is to install the Pinyin input method for IBus input framework. While there many Chinese input methods, the Pinyin is the easiest as it's based on phonetic (pronunciation) rather than graphological (stroke order).
What are the available Pinyin input method for IBus framework in Ubuntu?
$ apt-cache search pinyin | grep ^ibus ibus-sunpinyin - sunpinyin engine for ibus ibus-libpinyin - Intelligent Pinyin engine based on libpinyin for IBus ibus-pinyin - Pinyin engine for IBus
You can install all three but it will be a hassle later to switch between input methods using the Super/Windows + Space key. Is best to use install one Chinese input method so that you can just easily toggle between English and Chinese input methods. Now, that leads us to the next question, which Pinyin input methods should be install?
Forget about the ibus-pinyin input method. This is a fundamental and limited. For example, you can't even input the phrase "看法" (opinion) without having to key in each individual word separately. ibus-libpinyin is a newer and better Pinyin input method, which also include Chinese ZhuYin (Bopomofo), using phonetic notation which still popular in Taiwan. Lastly, ibus-sunpinyin, which uses SLM (Statistical Language Model) to determine the probability of a sequence of words when you key in the Pinyin. We'll use the Sun Pinyin method for this setup guide.
Installation is straightforward, just apt-get install it.
$ sudo apt-get install ibus-sunpinyin
Next, we need to enable above installed input method through Text Entry Settings, which is located at the top right panel, see screenshot below.
Click the '+' button and type in 'chi' to show all Chinese input source. However, the SunPinyin we've just installed does not show up in Text Entry. You have to logout and re-login to the Unity Desktop environment again. I missed this step while following the guide by PYJ and wasted quite a few days redoing and retracing my steps again and again.
Logout and re-login again and go back to the Text Entry Settings again. This time the Sun Pinyin will be shown in the input sources list as shown. Note that restarting Unity without logging out did not work. You have to really logout and try again.
After this, clicking language selection on top right panel will show the SunPinYin selection. As mentioned before, to toggle between two input methods, just use the Super/Windows + Space Key.
Launch Gedit and toggle to SunPinyin, you can now input Chinese characters in Ubuntu 15.04.
On a related note, I've been using Fedora 22 for the past 9 months as my primary GNU/Linux distros. The whole GNOME desktop environment feels more integrated and polish compare to Ubuntu 15.04's Unity desktop environment. Pity though, I really like Fedora 22 but I've to switch to Ubuntu due to more up to date software packages and choices.