Just a quick update on an apparently old post. In Gnome 3+ versions (don’t know about older ones), you can just add japanese as a keyboard setting. Just the same for typing, space bar changes the to kanji with a browseable menu and F7 changes the typed word to katakana.
Since this is just the keyboard setting for your desktop interface, it works in all programs you run in the same shell.