Writing Japanese with Ubuntu 14.04 Trusty Tahr

来源:互联网 发布:程序员是吃青春饭吗 编辑:程序博客网 时间:2024/05/22 02:01

This is a follow-up of the former articles "Writing japanese with Ubuntu 12.04 Precise Pangolin" and "Writing japanese with Ubuntu 10.04 Lucid Lynx".

When comparing to Ubuntu 12.04, the Japanese input is now a lot easier to install and better integrated into the interface. Additionally you now have the choice between two input methods. I will guide you through both and you can then choose for yourself which you like more.

But first things first for people who haven't typed Japanese in Linux before: The input-methods that are available in Ubuntu 14.04 areAnthy andMozc. There are others but those are practically the standard ones today and work very well while having all the features you will probably ever need. Anthy has been around for several years and is used as the default in Japanese installations of Ubuntu. However, nowadays there is also Mozc around, which is besically the open-source-version ofGoogle's IME and is in my personal opinion superior because from my experience it gives better results in the candidates list and also has symbols built-in (e.g. ☎). First I will show you the installation and setup of Anthy and after that how to install Mozc.

Anthy

  1. Because Anthy is not installed with the base-system, you have to install the Japanese language support first. Otherwise Anthy won't be available as input-method in the Text Entry settings. Additionally this will install some nice Japanese fonts and Japanese translations for Ubuntu if you ever want to use your System in Japanese. So let's begin by opening theSystem Settings and then the Language Support.

    Screenshot-from-2014-03-28-062826.png


  2. In the Language Support-window, click on "Install / Remove Languages...".

    Screenshot from 2014-03-28 06:32:01


  3. Scroll down or type "J" and check the checkbox next to Japanese in the "Installed"-column. After this, click on "Apply Changes".

    Screenshot from 2014-03-28 06:32:19


  4. Next you have to enter your password.

    Screenshot from 2014-03-28 06:32:45


  5. The necessary packages will now be downloaded and installed. Nothingto do in this step. :-)

    Screenshot from 2014-03-28 06:32:57


  6. After the Japanese language support is installed, you have to logout. For Anthy to show up in the list of input-methods, the session needs to be restarted. This is really kind of annoying but there's nothing you can do about that at this point. :-(


  7. Once you did a logout / login-cycle, reopen the System Settings and this time click onText Entry.

    Screenshot from 2014-03-28 06:29:52


  8. In the "Text Entry"-window, click on the small Plus-sign at the bottom of "Input sources to use".

    Screenshot from 2014-03-28 06:30:17


  9. Select the entry "Japanese (Anthy)" from the list and click on "Add".

    Screenshot from 2014-03-28 06:48:10


  10. "Japanese (Anthy)" should now show up inside the "Text Entry"-window and Anthy should be available in menu-bar's menu. You probably want to change the setting "Use the same source for all windows" to "Allow different sources for each window" and switch to "New windows use the default source". Also you want to reassign the key to switch to the next input source eventually. I normally use the "Pause"-key to toggle between languages.

    Screenshot from 2014-03-28 06:49:29

    Screenshot from 2014-03-28 06:49:42


  11. Now fire up some text-editor and try it by clicking on "Anthy" in the menu bar and type some japanese. Switching between candidates is done by pressing the spacebar and katakana-conversion is done by pressing F7.

    Screenshot from 2014-03-28 16:51:14

That's it for Anthy. If you want to add Symbols (e.g. the aforementioned ☎) and want to know more about Anthy, you can head over to my article "Some Secrets of IBus / Anthy".
OK, next is Mozc.

Mozc

  1. To install Mozc, you have to open a terminal by pressing Ctrl+Alt+T and enter "sudo apt-get -y install ibus-mozc".
    moritz@master:~$ sudo apt-get -y install ibus-mozc


  2. After you installed the package, you have to logout. Otherwise Mozc won't show up in the available input-sources.


  3. Once you did a logout / login-cycle, open the System Settings and click onText Entry.

    Screenshot from 2014-03-28 06:29:52


  4. In the "Text Entry"-window, click on the small Plus-sign at the bottom of "Input sources to use".

    Screenshot from 2014-03-28 06:30:17


  5. Select the entry "Japanese (Mozc)" from the list and click on "Add".

    Screenshot from 2014-03-31 00:03:29


  6. "Japanese (Mozc)" should now show up inside the "Text Entry"-window and Mozc should be available in menu-bar's menu. You probably want to change the setting "Use the same source for all windows" to "Allow different sources for each window" and switch to "New windows use the default source". Also you want to reassign the key to switch to the next input source eventually. I normally use the "Pause"-key to toggle between languages.

    Screenshot from 2014-03-31 00:03:46

    Screenshot from 2014-03-31 00:04:01


  7. Now fire up some text-editor and try it by clicking on "Mozc" in the menu bar and type some japanese. Switching between candidates is done by pressing the spacebar and katakana-conversion is done by pressing F7.

    Screenshot from 2014-03-31 00:06:13




I hope, this article answered all your first questions regarding Japanese input in Ubuntu.


If this article was useful to you, you might also be interested in my (short) list of extremely useful Japanese software and websites.



19 Responses to “Writing Japanese with Ubuntu 14.04 Trusty Tahr”

  1. Andy
    April 22nd, 2014 at 00:38
    1

    I tried this, but neither anthy or mozc shows up as an option for when trying to add Japanese in “Text Entry”. Anthy worked fine for the last several releases. I upgraded to 14.04 and lost Japanese support. I’ve tried removing and re-adding Japanese in the “Language Support”. I’ve logged out and back in. No luck.

  2. Moritz
    April 22nd, 2014 at 01:09
    2

    If you upgraded from a previous release and took over your old settings, I recommend to open a terminal and enter
    dconf reset -f /desktop/ibus/
    to reset the old ibus-configuration. Eventually a re-login could be necessary.

  3. Rinasu
    April 27th, 2014 at 12:53
    3

    Thank you for detailed instructions. Unfortunately, I encounter the same problem as Andy – neither mozc, nor Anthy are among Text Entry input sources. I used Anthy in 13.10 without any problems but it just stopped working after upgrading to 14.04 :-/

    “dconf reset -f /desktop/ibus/” didn’t solve the problem.

  4. Moritz
    April 28th, 2014 at 00:46
    4

    The options were available when running Gnome-Shell instead of Unity when I ran into this problem and I added them there. Later on I reset the old ibus configuration in dconf and now it’s working fine for me in Unity as well. It could be that I also deleted some other ibus-related config-files though…

  5. Rinasu
    April 28th, 2014 at 16:44
    5

    I finally solved it. Somehow…

    I usually use Gnome Classic which, as I explained, has Text Entry which does not allow to add mozc. However, if I go to iBus preferences, I can add mozc in the “Input Method” tab. It then shows up in iBus menu and when I select it, I can write in Japanese. Half a problem solved. Another half is that I couldn’t assign a hotkey to switch between English keyboard and mozc because hotkeys are set only for input methods selected in Text Entry but not for iBus. So what I did is to log into Gnome (non-classic). There I couldn’t find Text Entry. Instead there was another keyboard settings window and, surprise surprise, there I could add mozc. This way I could use ctr+alt or another hotkey to switch between input methods. When I logged back to Gnome Classic, the changes I made remained and everything now works fine. However, Text Entry still doesn’t show mozc so I don’t know how it works… but it works. :-)

  6. Romel Pérez
    May 23rd, 2014 at 23:25
    6

    Hi!

    I had the same problem, but I solved it!

    I was not able to add the Anthy text entry in Ubuntu 14.04 using Gnome Fallback. Then I switch to Gnome Shell and I add it. Finally I switch back to Gnome Fallback and I can use it now.

    まったね!

  7. John K.
    May 31st, 2014 at 20:02
    7

    Bless you! I searched a long while before finding your explanation, which is crystal-clear. It all works. ありがとう!

    Separate question: I notice that some of the keys on my JIS keyboard OADG 109A don’t match up with the Anthy / Mozc layout. For example, the @ symbol is printed on one of the lefthand upper keys on OADG 109A, but to type it with Anthy or Mozc, I need to type Shift and the numeral 2 key. Is there a simple way to edit the keys?

  8. Moritz
    May 31st, 2014 at 20:08
    8

    I don’t know if this solves your problem but you can try to open the IBus preferences (type “ibus-setup” in a terminal), go to the Advanced-tab and toggle the “Use system keyboard layout”-checkbox. This setting needs a re-login if I remember correctly.

  9. Noriho
    June 8th, 2014 at 12:06
    9

    Thanks for this perfect recipe.
    I think the Japanese translation page would be appreciated by many ubuntu users in Jap

0 0
原创粉丝点击