How To Install A Japanese Keyboard

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
Gee7

How To Install A Japanese Keyboard

Post by Gee7 »

= ================= =

Update 04 May 2012

This post was originally written in June 2011 and applied to the Gnome 2 desktop environment.

Initially there were a few problems with the new Mate desktop environment but these have now been resolved.

The system for Japanese input as described below now works like a dream with Mate too.

Thank you Mint team for all your hard work.

To test your Japanese input, open Leafpad or Puma or your own text editor, click to change the panel language En to Jp, and use Control+space to input Japanese.
Type にほん (Japanese hiragana word for "Japan" pronounced "nihon") and immediately press the space bar, にほん will then change to the kanji 日本 (nihon written in kanji i.e. Chinese characters, as it is usually written in Japan) and press Enter to confirm that you want kanji for that word. Test successful.

gee 7

= ================= =

How To Install A Japanese Keyboard

This post is to help users set up a Japanese keyboard on Linux Mint or other Linux distributions.

A user following the instructions below can copy and paste the commands into a terminal.

You should first install your operating system in your native language e.g. English or French or Whatever and then add Japanese as a second supported language.

With a Japanese keyboard you can write a word or a sentence in English (or whatever your native language is), then a word or sentence in Japanese, and then switch back to English again.

If you are looking for a new keyboard, at the time of writing this there is a good Ceratech Accuratus 260 Japanese PS/2 keyboard from Hypertec for around £25 on Amazon UK.

I am Level 1 at Japanese and Level 1 at Linux, so may not be able to answer theoretical technical questions – however, I have practical experience, having installed and used Japanese keyboards on Debian, Linux Mint Debian, Linux Mint Katya and before finalising this how-to I downloaded Ubuntu 11.04 Natty Narwal and installed a Japanese keyboard on that too, so I can confirm that the following installation methods work. The methods were found by online research (grateful thanks to those who have gone before and posted their knowledge and apologies for not making notes of the names of people who posted re this subject), and then a lot of trial and error. Following the sequence below, it shouldn't take too long to get your keyboard up and running.

Once installed, you will find that some of the keys are in unexpected places, for example the @ may be found on the key bearing a *. The letters of the English alphabet are all in the correct place, just some of the punctuation goes astray. This is because Linux gives only partial support to Japanese keyboards. You will need to play around.

The first part describes how to install a Japanese keyboard on Debian 6.00 and Linux Mint Debian and the second part how to install a keyboard on Linux Mint Katya and Ubuntu Natty Narwhal.

gee7

June 2011

= ================= =

Part 1: How to install a Japanese keyboard in Linux Mint Debian 1 and in Debian 6.00

To enable English and Japanese (Romaji, Katakana, Hiragana and Kanji).

(1) In your operating system menu, go to Control Centre/Keyboard/Layouts/ and click on Add.
A list of countries and keyboards will come up. Select:

Country: Japan
Variants: Kana

(2) Use Synaptic Package Manager to install a variety of Japanese fonts. In Synaptic search bar, type “fonts” (without the apostrophe) and install:

xfonts-int1-japanese
xfonts-a12k12
xfonts-jisx0213
ttf-takao and any dependencies (ttf-takao-gothic, ttf-takao-mincho)

(3) Use Synaptic Package Manager to install:

scim-anthy and dependencies. This helps to convert from katakana to hiragana. Install:

anthy, anthy-common, libanthy0, im-config, kasumi, libscim8c2a, scim, scim-bridge-agent, scim-bridge-client-gtk, scim-gtk2-immodule, scim-modules-socket, scim-anthy, scim-tables-ja, scim-modules-table, scim-canna, libcanna1g, ack

NB. The package im-config removes and replaces im-switch.

(4) Gedit is the name of my Text Editor. It is the standard editor that comes with Linux Mint. If you are using another text editor, then replace the command “gedit” with the name of your own editor.

Open a terminal as root and edit your locales file so that your chosen languages are enabled:

$: gedit /etc/locale.gen

You will see a long list of names of languages starting with the # sign.

Scroll down the list and uncomment (delete the # sign in front of) the 2 lines of Japanese and for the UK and US English UTF-8, so that you get:

en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8

You now have 2 types of common English and 2 types of Japanese without the # sign. This enables them.

All the languages remaining with a # in front of them are available but will not be used – the # sign means that what follows is only a comment or description, and not an active process. Take away the # and the process comes alive.

Save your changes.

Then in the terminal type the following code to generate these locales:

$: locale-gen

(5) Reboot your system and use your Japanese keyboard.

Open a text editor or Open Office or Libreoffice to test your settings. An Input Window must be open for the Japanese settings to start up.

In the task panel, near the date and time, you will see the name of your default language e.g. Gbr. Click on this and change it to Jpn, then press Ctrl+Spacebar and the Scim-Anthy Language Toolbar should pop up.

This toolbar will be available at all times.

Try typing a few letters in hiragana, then change the hiragana あ to the katakana ア in the Scim-Anthy Language toolbar (or click twice on the kana key next to right Alt) and type some letters in katakana.

Use Ctrl+ Space and the kana key next to Left Alt to switch between settings.

To type in kanji, write a word in hiragana and press the space bar twice, and a kanji menu will pop up. Select the correct kanji from that menu and press Enter.

Katakana: ハッピーバースデー。

Hiragana: よかったです。

Kanji: 日本

English: Good luck

= ================= =

Part 2: How to install a Japanese keyboard in Linux Mint 13 Maya Mate .

Installing a keyboard for Japanese is fiendishly difficult on an Ubuntu-based O/S until you know how. Then it's a piece of cake.

Such systems use a tool called ibus which superficially seems to work because it lets the user quickly type katakana. However the Japanese language consists of hiragana (a 43-character alphabet), katakana (a 43-character alphabet) and kanji (Chinese characters, of which about 2000 are needed as a base). It would be possible to write only in hiragana and be understood by Japanese, but katakana alone is not a tool of communication. Katakana is the least used of the 3 alphabets and the necessity is to acquire and enable hiragana.

I could not get ibus to work with hiragana, although there may be a way which I missed, or some glitch in my system. After installing ibus, I could only type in katakana. So I took the long way round and followed the Debian way of working with scim rather than ibus. By default, the Ubuntu system goes out of its way not to enable scim (maybe because it supports ibus instead, I guess) so the user has to configure some files in the terminal. Anyway, my system is working smartly now. If I have needlessly gone the long way round, it has been of benefit because I both gained knowledge and installed a perfect working system.

To enable English and Japanese (Romaji, Katakana, Hiragana and Kanji).

(1) In your operating system menu, go to Menu/Preferences//Keyboard/Layouts/ and click on Add.
A list of countries and keyboards will come up. Select:

Country: Japan
Variants: Kana

(2) Don't bother with Control Centre/ Language Support. If you download Japanese language packs here, you will also be downloading ibus and other unnecessary files. You can get all your language packs and tools from Synaptic Package Manager.

Open Synaptic Package Manager and in Synaptic search bar, type “fonts” and select :

xfonts-int1-Japanese;
xfonts-a12k12; xfonts-jisx0213;
ttf-takao and any dependencies suggested by Synaptic (ttf-takao-gothic, ttf-takao-mincho)

If you cannot find ttf-takao-gothic, ttf-takao-mincho in Synaptic, you can find them using a Duck Duck Go or Google search and install them. In fact, as other fonts have neen installed, they may not be so strictly necessary now.

Now you have installed the fonts, install scim and more Japanese support. Kasumi is a kanji dictionary which scim-anthy uses when converting from hiragana. Install the following applications:

anthy, anthy-common, libanthy0, im-config, kasumi, libscim8c2a, scim, scim-bridge-agent, scim-bridge-client-gtk, scim-gtk2-immodule, scim-modules-socket, scim-anthy, scim-tables-ja, scim-modules-table, scim-canna, libcanna1g, ack

NB. The package im-config removes and replaces im-switch.

(4) Pluma is the name of my Text Editor. It is the standard editor that comes with Linux Mint Mate. If you are using another text editor, then replace the command “pluma” with the name of your own editor.

Open a terminal and type:

$: gksu pluma /var/lib/locales/supported.d/local

when the file opens, add the following languages (i.e. add languages that are not already present) if you want British English, American English and Japanese:

en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8

and Save the file.

Then run the following command:

$: gksu dpkg-reconfigure locales

Now your computer will be prepared for both English and Japanese. However, scim will not be naturally enabled by Ubuntu, so we have to do this in the terminal. First edit your profile in /etc/profile:

$: gksudo pluma /etc/profile

Add add the following lines

# SCIM
export XMODIFIERS='@im=SCIM'
export GTK_IM_MODULE="scim"
export XIM_PROGRAM="scim -d"
export QT_IM_MODULE="scim"
scim -d

and Save the file then close it down.

Next add your locale to /etc/scim/global:

$: gksu pluma /etc/scim/global

This file will look something like:

/SupportedUnicodeLocales = en_US.UTF-8
/DefaultPanelProgram = scim-panel-gtk
/DefaultConfigModule = simple
/DefaultSocketFrontEndAddress = local:/tmp/scim-socket-frontend
/DefaultSocketIMEngineAddress = local:/tmp/scim-socket-frontend
/DefaultSocketConfigAddress = local:/tmp/scim-socket-frontend
/DefaultPanelSocketAddress = local:/tmp/scim-panel-socket
/DefaultHelperManagerSocketAddress = local:/tmp/scim-helper-manager-socket
/DefaultSocketTimeout = 5000

If you see the line '/SupportedUnicodeLocales = en_US.UTF-8 ' as above, then add the other languages to the line so that it becomes:

/SupportedUnicodeLocales = en_US.UTF-8, en_GB.UTF-8, ja_JP.EUC-JP, ja_JP.UTF-8

If for any reason that line is not there, then, add a line giving your locale list names using commas between each name. For British English, American English and Japanese you type the following:

/SupportedUnicodeLocales = en_US.UTF-8, en_GB.UTF-8, ja_JP.EUC-JP, ja_JP.UTF-8

Reboot to apply settings.

(5) Open a text editor or Open Office or Libreoffice to test your settings. An Input Window must be open for the Japanese settings to start up.

In the task panel, near the date and time, you will see the name of your default language e.g. Gbr. Click on this and change it to Jpn, then press Ctrl+Spacebar and the Scim-Anthy Language Toolbar should pop up. If the Anthy toolbar does not pop up, click on the icon in the panel and select Anthy.

This toolbar will be available at all times.

Try typing a few letters in hiragana, then change the hiragana あ to the katakana ア (or click twice on the kana key next to right Alt) and type some letters in katakana.

Use Ctrl+ Space and the kana key next to Left Alt to switch between settings.

To type in kanji, write a word in hiragana and press the space bar twice, and a kanji menu will pop up. Select the correct kanji from that menu and press Enter.

Katakana: ハッピーバースデー。

Hiragana: よかったです。

Kanji: 日本

English: Good luck

= ================= =
Last edited by Gee7 on Sun Jun 17, 2012 9:24 pm, edited 8 times in total.
Gyver

Re: How To Install A Japanese Keyboard

Post by Gyver »

Wow! Clearly said! I am planning to go to make online friends in Japan and I want to communicate with them through their language. Thanks!
Gee7

Re: How To Install A Japanese Keyboard

Post by Gee7 »

Hi Gyver
お元気ですか。
You are welcome, I hope it was useful.
Sorry for late reply, your post has just come to my attention.
Good luck with your language learning, it can be fun.
また、あとでね!
ジ--七 (gee7)
geqo

Re: How To Install A Japanese Keyboard

Post by geqo »

It worked! Thank you!
bakashasha

Re: How To Install A Japanese Keyboard

Post by bakashasha »

Hello!

I am on LinuxMint 14 Nadia, and I followed the process you gave to install japanese input. Well, it worked a little too much ^^'.
When I restarted my computer I did have the little keyboard near the date and time, but all the menus are in japanese, included SCIM, which is also entirely in japanese.I can switch for the hiragana keyboard but did not find how to switch again to french, fortunately CTRL+SPACE worked ^^'. Moreover, I could type hiranagas on my text editor but it did not work on skype, where I want to use it.
I am afraid to make a mistake now because I can read kanas but not kanjis ^^'. my computer language hasn't changed though.
Can you help me?
Thank you

Edit : I made some changes in keyboard settings and after restarting the taskbar keyboard is back in french. But I still can't type in japanese on skype :(
Post Reply

Return to “Tutorials”