Update: For Ubuntu 12.04 and 12.10, please use this guide.

Update: For Ubuntu 14.04, please use this guide.

With Ubuntu karmic came a new input system named ibus which replaced the old scim. ibus is completely written in python and makes use of dbus to connect to a variety of input methods. The best input method to write japanese is Anthy. I will show you, how to set it up and show you some configurations which I prefer.

  1. Click on System->Administration->Language Support
  2. Click on "Install / Remove Languages..."
  3. Scroll down to Japanese and select it. Select the checkbox "Input methods". (I recommend to to install the extra fonts too, although you don't necessarily need them. "Translations" allows you to use your system in japanese. It is a great way to learn computer-related japanese words. You can switch between languages in the login-screen. Note this bug if you plan to switch languages from the login screen.)
  4. Click on "Apply Changes", enter your password and let it work. Then close the window labelled with "Changes applied".
  5. Set the "Keyboard input method system" to ibus.
  6. Log out and log in to start the ibus daemon.
  7. Now you should see the small keyboard sitting in your notification area.

    Left click on it to show a menu. Select "Preferences".

  8. Switch to the tab called "Input Method". Click on "Select an input method" and select "Japanese->Anthy" from the list. Don't confuse it with "anthy (m17n)".
  9. Click on "Add".
  10. Remove the "ispell (m17n)" input method by selecting it and clicking on "Remove". The result should look like this:
  11. Now you can try writing japanese by hitting "Ctrl+Space" in your text-editor of choice. Notice the input language bar in the right bottom corner.
  12. Pressing space will show you a list of choices and pressing "Ctrl+." lets you rotate between hiragana, katakana and half-width-katakana. "F7" lets you convert directly into katakana.

If you like it that way, then you're done. My problem with this configuration is, that "Ctrl+Space" triggers autocomplete in most programming IDEs, so I will show you my configuration.

  1. I use "F3" to write japanese and remove all other keybindings. I also want my candidates list to be horizontal.

  2. Clicking on the "i" on the input language bar will open the configuration panel for Anthy.



    You can play around with the settings but I personally like the default behaviour on this tab. Eventually you might want to play with "Behaviour on Focus Out". The "Key binding" tab is more interesting to me since I use always set the "convert_to_katakana" keybinding to "F4" instead of "F7".

Thank you for reading and have fun writing japanese in Ubuntu 10.04 Lucid Lynx.

UPDATE: If this article was useful to you, you might also be interested in Some Secrets of IBus-Anthy or Tagaini Jisho or if you know german "wadoku-notify".



10 Responses to “Writing japanese with Ubuntu 10.04 Lucid Lynx”

  1. Anonymous
    June 23rd, 2010 at 14:57
    1

    どうもありがとう!

  2. NO NAME REQUIRED
    July 14th, 2010 at 06:08
    2

    ありがとう!
    Very good tutorial and very helpful!!

  3. Jim Richards
    July 21st, 2010 at 02:13
    3

    Setting up Japanese now is so much easier than what it was a few years ago. I found that the Sazanami Mincho and Gothic fonts to be the best, their Roman characters display much better. Also, to configure the fonts for programs like Gjiten, take this file and put it as ~/.fonts.conf and it will fix fonts and anti-aliasing issues.

    serif

    DejaVu Serif
    Sazanami Mincho

    sans-serif

    DejaVu Sans
    Sazanami Gothic

    monospace

    DejaVu Sans Mono
    Sazanami Gothic

    ja

    false

    true

    true

    hintnone

  4. Jim Richards
    July 21st, 2010 at 02:14
    4

    Oh, that didn’t paste so well. Let’s try again.

    <?xml version=”1.0″?>
    <!DOCTYPE fontconfig SYSTEM “fonts.dtd”>
    <fontconfig>

    <alias>
    <family>serif</family>
    <prefer>
    <family>DejaVu Serif</family>
    <family>Sazanami Mincho</family>
    </prefer>
    </alias>

    <alias>
    <family>sans-serif</family>
    <prefer>
    <family>DejaVu Sans</family>
    <family>Sazanami Gothic</family>
    </prefer>
    </alias>

    <alias>
    <family>monospace</family>
    <prefer>
    <family>DejaVu Sans Mono</family>
    <family>Sazanami Gothic</family>
    </prefer>
    </alias>

    <match target=”font”>
    <test name=”lang” compare=”contains”>
    <string>ja</string>
    </test>
    <edit name=”embeddedbitmap” mode=”assign”>
    <bool>false</bool>
    </edit>
    <edit name=”autohint” mode=”assign”>
    <bool>true</bool>
    </edit>
    <edit name=”antialias” mode=”assign”>
    <bool>true</bool>
    </edit>
    <edit name=”hintstyle” mode=”assign”>
    <const>hintnone</const>
    </edit>

    </match>

    </fontconfig>

  5. Roy Candler
    September 9th, 2010 at 22:16
    5

    Brilliant! I was baffled before, but now it all works fine. I think the turning-point was your tip to delete “ispell(m17n)”, as after that it was simplicity itself to swap between English and Japanese.

  6. sakti dwi cahyono
    September 24th, 2010 at 01:03
    6

    ありがと
    very helpfull
    thanks you

  7. Mark Bellis
    October 29th, 2010 at 22:59
    7

    Hi,
    Thanks for the tutorial. I’ve been using the pyrikai plug-in with gedit (text editor) on ubuntu – it gives you the mouse over translation thing that rikai-chan does in firefox. Tricky (for me) to install but fun!

  8. Moritz
    October 30th, 2010 at 19:04
    8

    @Mark Bellis
    Thanks for the tip. Pyrikai looks very interesting!

    Update: I looked into Pyrikai and it is an interesting project but since it slows down gedit and I don’t see any advantages over Stardict‘s mouseover translation I don’t think it is that useful. Stardict can’t compete with Firefox’s Rikaichan but it works everywhere and is a nice tool to quickly get translations.
    Nevertheless Pyrikai has some interesting code and I could see some of it being used in maybe a Cardapio- or GnomeDo-Plugin.

  9. twistle
    December 11th, 2010 at 11:15
    9

    Thank you so much! I was (unknowingly) using anthy(m17n) and it was driving me crazy! This should be added to the official Ubuntu guide!

  10. Roy Candler
    January 25th, 2011 at 22:31
    10

    It gets better! I’ve just followed this procedure on a machine with Ubuntu 10.10 and there is now no ispell(m17n) to remove.

Leave a Comment