2

I just upgraded from Ubuntu 16.04 to 18.04 because of the Japanese (Mozc) Keyboard Layout problem and it persists in 18.04. Here is the problem described:

When using mozc to input Japanese, it's using the last selected keyboard layout to input romaji - can I fix which one it uses?

Below the answer is a comment that says I should install fcitx to get the "Configure Current Input Method" option. For that person it seems to have worked. But not for me.

In "Language Support" (Settings > Region & Language > Manage Installed Languages), I see under "Keyboard input method system" the following options: fcitx, IBus, XIM, none. Whichever option I choose I don't get the "Configure Current Input Method" option. And therefore I can't set the keyboard layout for Japanese (Mozc).

What am I doing wrong? I need to write Japanese and German, but writing Japanese and having a German keyboard layout pushed on me is really inconvenient.

My mozc.xml looks like this:

<component>
    <version>2.20.2673.102+dfsg-2</version>
    <name>com.google.IBus.Mozc</name>
    <license>New BSD</license>
    <exec>/usr/lib/ibus-mozc/ibus-engine-mozc --ibus</exec>
    <textdomain>ibus-mozc</textdomain>
    <author>Google Inc.</author>
    <homepage>https://github.com/google/mozc</homepage>
    <description>Mozc Component</description>
<engines>
<engine>
    <description>Mozc (Japanese Input Method)</description>
    <language>ja</language>
    <symbol>&#x3042;</symbol>
    <rank>80</rank>
    <icon_prop_key>InputMode</icon_prop_key>
    <icon>/usr/share/ibus-mozc/product_icon.png</icon>
    <setup>/usr/lib/mozc/mozc_tool --mode=config_dialog</setup>
    <layout>default</layout>
    <name>mozc-jp</name>
    <longname>Mozc</longname>
</engine>

How should it look like at the end? Do the first two lines mean, I should make a backup copy? What do the @@ lines mean? And remove default and add jp? I'm trying to edit the file with gedit. Thank you very much for your help?

  • Are you using KDE or Gnome? Why are you using IBUS? I have had more success with fcitx-mozc (in KDE, Gnome should come with an input method out of the box). However, concerning your question this might help: wiki.archlinux.org/index.php/IBus Scroll down to "Non US keyboards". – David Apr 29 '18 at 6:10
  • I use fcitx. I see a little keyboard symbol and a あ symbol on the right of it on the top right of the screen. Sometimes the small keyboard symbol turns into an orange あ symbol. I tried every tip I could find on the net, but it is getting worse, not better. At the moment I can't even right hiragana anymore, even if I choose it in the drop down menu. Sometimes I can only write hiragana. What I want is 1. Japanese (Mozc) and 2. German (QWERTY) as my languages. – Bernhard Apr 29 '18 at 6:57
  • I tried to add a third keyboard layout "English (US)" and the whole thing froze and I couldn't get in anymore. -> Total reinstall. Now I have only the keyboard layout for "Japanese" and that is exactly what I need, but of course I can't type hiragana and German special characters yet. What should I do? – Bernhard Apr 29 '18 at 9:01
  • I give up ... I installed "fcitx-mozc" twice and both times my OS froze and never recovered. Twice I reinstalled the whole OS. I use IBUS now and I have only two languages in the keyboard layout list: 1. Japanese, 2. Japanese (Mozc). Like this I can be sure, I will always have the Japanese keyboard layout. If I install the German layout, I get the problem with the interference Japanese (Mozc) with a German layout. And I have to use the compose key or the Ctrl + Shift + U thing to get my special German letters. If anyone has a solution for me, then please tell me. – Bernhard Apr 29 '18 at 15:07
2

I think that David provided a useful hint. ibus-mozc does not seem to provide a GUI for controlling the keyboard layout used together with Mozc, but you can edit the file /usr/share/ibus/component/mozc.xml:

--- /usr/share/ibus/component/mozc.xml.orig
+++ /usr/share/ibus/component/mozc.xml
@@ -16,7 +16,7 @@
   <icon_prop_key>InputMode</icon_prop_key>
   <icon>/usr/share/ibus-mozc/product_icon.png</icon>
   <setup>/usr/lib/mozc/mozc_tool --mode=config_dialog</setup>
-  <layout>default</layout>
+  <layout>jp</layout>
   <name>mozc-jp</name>
   <longname>Mozc</longname>
 </engine>

Or in plain English:

Replace the line

  <layout>default</layout>

with

  <layout>jp</layout>

With that change (and after a relogin), Japanese (Mozc) will always be based on the basic Japanese keyboard layout, irrespective of which keyboard layout you switched from when enabling Japanese (Mozc). Hence you can add e.g. the German layout without it affecting your use of Japanese (Mozc).

HTH

  • How should it look like at the end? Do the first two lines mean, I should make a backup copy? What do the @@ lines mean? And remove <layout>default</layout> and add <layout>jp</layout>? I'm trying to edit the file with gedit. Thank you very much for your help? – Bernhard Apr 29 '18 at 23:56
  • @Bernhard: Sorry about that; please see my edited answer. Yes, editing it using gedit is fine. (That's what I did when testing.) – Gunnar Hjalmarsson Apr 30 '18 at 0:03
  • Hi Gunnar, thank you very much. Right at this moment, it is working. 1. Japanese (Mozc) and 2. German (QWERTY). And when I change the languages, then the layouts are always right. – Bernhard Apr 30 '18 at 0:37
  • @Bernhard: I'm glad to hear that. :) – Gunnar Hjalmarsson Apr 30 '18 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.