Most English users, as well as many who speak other languages, have some form of the QWERTY keyboard, so what do you do when you wish to communicate by typing in a language that differs from your installed locale?
Linux supports input methods that allow you to type in your chosen language. The correct fonts also appear. As an example of what is possible, you can mix and match several languages within the same text file, enter non-locale text in a search engine, or compose an email to a faraway friend in his native tongue.
This updated article explains how to install support for the Japanese language on an English installation of Linux Mint 17.1 so we can type filenames, Internet searches, and compose emails from a QWERTY keyboard.
The process is similar for most Linux distributions, and any language can be installed. In this example, we are using Linux Mint 17.1 (Cinnamon) due to its excellent language support, and Japanese was chosen since its typed characters look nothing like English. When we see Japanese text, we will know for certain that everything is working properly.
Installing an alternate input method in Linux Mint 17.1 is not complicated, but it requires a number of steps. Here is a complete installation and usage tutorial with pictures.
Step 0: Linux
This article demonstrates with Linux Mint 17.1 with an English locale. The default language and keyboard layout is chosen during Linux installation. If you already have Linux installed with a different default language, there is no need to reinstall Linux.
Here, I chose English (US) since that seems to be the most common. English (UK) or one of the others would also work. The different versions allow for nuances in the different varieties of English.
Step 1: Ensure Repository Support
You will need a working repository in order to install language files. Ensure that you can update Linux and install programs.
Step 2: Install Default Language Support
(This step can be skipped if all language packs already exist for your default language.)
Go to System Settings and open Languages (The blue icon with the EU symbol).
The first thing we want to do is install language support for the default language. Click the Install / Remove Languages button located in the top half of the dialog. You will need to enter the root password because this makes system-level changes.
Surprisingly, a default installation of Linux Mint 17.1 might not have all language files installed.
Notice text that reads, “Some language packs are missing.” We need to correct this now by install them. Since we chose English (US) as the default language, select it and then click the Install language packs button.
This is why we need a working repository. If one does not exist, then this message will appear:
After the language packs have installed, the green text will read, “Fully installed.”
This is something that should be completed as part of a standard Linux installation whether on not you will use an additional language.
Step 3: Install the New Language
We install a new language similar to step 2. Click the Add… button to open the Add a New Language dialog.
This is where we can choose from a multitude of languages possible on Linux. There are many! Since this example demonstrates with Japanese, scroll down to find Japanese (or press “j” on the keyboard) and select the line that reads Japanese,Japan UTF-8 and click the Install button. You will return to the Install / Remove Languages dialog.
Did you notice that all English languages showed UTF-8? This is why we are choosing the UTF-8 version of Japanese. It has always worked well for me, so I never bothered with the EUC-JP version.
Back in the Install / Remove Languages dialog, scroll all the way to the bottom to find that Japanese has been added to the list. However, you cannot use it yet because its language pack is not installed.
Select the Japanese line and click the Install language packs button to install its language pack just like we did in Step 2 for English.
Once complete, the languages list will show that Japanese has been installed.
Close the dialog and return to the Language Settings dialog.
Step 4: Install an Input Method
Even though Japanese is available on the system, we cannot use it yet. Any typing will still be in English, not Japanese. We need a way to switch between languages in order to type in Japanese on the keyboard.
This is what an input method does, and we are going to install one now.
If you look at the Input method section located in the lower half of the Language Settings dialog you will see that Input method is blank with a list of five options below it labeled IBus, Fcitx, SCIM, UIM, and gcin.
These are various input methods and none of them are installed. We only need one. My personal favorite is the Intelligent Input Bus (IBus), and we will install that one. The others behave in a similar manner and offer their own features. For Japanese, IBus works well.
Click the Add support for IBus button to install it. Leave the others alone since they are not necessary uless you wish to experiement.
(After installation, consult man ibus for more IBus information.
Once installed, we should see green text below IBus that reads, “50 optional components available.”
Let’s install them too, so click the Install the optional components button. Remember that language installation requires root privileges, so you will need to enter the root password to perform these steps.
When complete, IBus will be fully installed.
Now, select IBus from the Input method dropdown menu.
We have Japanese installed. We now have an input method selected. But we are not finished yet! Attempting to type with Japanese text does nothing at this point.
Step 5: Log Out or Reboot
Yes, reboot. Actually, a simple log out and logging back in should work, but I tend to update the system at the same time, so a reboot ensures that all system updates are applied.
Step 6: Add Japanese – Anthy to the IBus List
When logged back in, look at the panel and there should be a new keyboard icon added.
If we click it now, we will see English – English (US).
This is the IBus menu showing a list of languages available on the system from which to choose to type with. But Japanese is not present in the list even though we installed its language packs earlier. We need to add Japanese to the list.
Right-click the IBus keyboard icon and choose Preferences.
This opens the IBus Preferences dialog.
Select the Input Method tab check Customize active input methods.
The languages that appear here are the languages that will appear in the IBus menu from which to choose. Since English is the only language in the list, this is why only English appeared when we clicked the panel’s IBus icon.
Open the Select an input method dropdown list and choose Show all input methods.
The list will close. Open the list again and scroll down until you find and highlight Japanese. Notice that a submenu appears with suboptions to choose from.
Anthy, Japanese, SKK, and more appear in the submenu. These are the various input methods for Japanese. Choose Anthy, a dictionary/utility input method that I find to be quite useful. Not perfect, but very convenient for Japanese typing.
If Anthy does not appear, then you might need to install it separately using the Software Manager.
Back at the IBus Preferences dialog, we will see Anthy chosen. Click the Add button to add it to the list. We should see it added below English.
Japanese – Anthy is added to the list, and we can now use Japanese. Close the dialog.
Now, if we click the IBus keyboard icon in the panel, we will see English and Japanese – Anthy from the menu.
Selecting Japanese – Anthy will switch the input method to Japanese text entry. By default, Ctrl + Space will also cycle through the input methods.
Step 7: Quick Test
At this point, Japanese text entry should be possible, so let’s test it. Open a text editor, and then choose Japanese – Anthy from the IBus keyboard icon. The IBus icon should change to show the Anthy icon to indicate that Japanese – Anthy is now active.
Type the word “watashi” (without the quotes) in the text editor by typing the QWERTY keys w-a-t-a-s-h-i (without the dashes). You should see Hiragana characters underlined like this:
If so, then all is good. If not, then Japanese text entry is not working properly. A reboot or log out might be required. Personally, I have never experienced any problems at this point, but you might want to check that the IBus service is running.
To do this, open Input Method from the Linux Mint menu (type input and it will appear). Do not confuse this with Keyboard Input Methods, which opens IBus Preferences.
From here you can choose which input method the system will use and it should start the daemon for you. Usually, if Japanese text entry is not working, I have found that the problem was usually because the IBus process was not running, so check that first. Or, try another input method, such as SCIM.
Step 8: Customize
At this point, your chosen language is fully functional, so any tweaks will be language-specific. In this case, there are two shortcuts we want to add to ease Japanese typing.
We want a way to quickly switch between Hiragana and Katakana (Japanese symbols that represent sounds) by using keyboard shortcuts. No such shortcuts exist yet, so switching between them requires the mouse and menus to select input modes from the Anthy menu, which can be interruptive when typing.
With the Japanese – Anthy input method active, left-click the Anthy icon in the panel and choose Preferences – Anthy.
This opens a dialog specific to the current input language.
We can also obtain the Anthy setup dialog by choosing Keyboard Input Methods from the Linux Mint menu.
This allows you to customize Japanese typing to a great level of detail. It’s well worth exploring to suit your tastes, but keep in mind that the preferences might be different for different languages. For now, we want to assign two keyboard shortcuts for Hiragana and Katakana in order to avoid using the mouse and menus.
Go to the Key Binding tab and select hiragana_mode.
Click Edit or double-click the selection to open the Edit Shortcut dialog.
Click the small … button and enter a non-conflicting keyboard shortcut when prompted.
Ctrl + h works well for me. We should see the updated dialog with the chosen keys.
Do not click OK yet. Click Add first! Click the Add button to add the shortcut to the list.
Once added, click OK to exit. If the shortcut does not appear in the list, then it will have no effect.
Back at the Setup-IBus-Anthy dialog on the Key Binding tab, we should see that the new shortcut has been assigned to hiragana_mode.
Do the same to assign a shortcut to Katakana. For me, Ctrl+k works well.
With both shortcuts assigned, click Apply to apply the changes and then click OK to close the dialog.
It’s time to have fun!
Everything we need for Japanese text entry is alive and active. We are now ready to begin typing in Japanese on a QWERTY keyboard. The technical installation details were the simple part. At this point, a knowledge of the Japanese language itself is required in order to communicate in Japanese.
Typing in another language is similar to speaking the language. Now, you must learn your chosen language. In this example, we used Japanese, but it could be Korean, Mandarin, Thai, Spanish, French, or any other. The same rules apply.
All we did was install the software needed to type in an alternate language. Japanese – Anthy is not a translator that magically translates English into Japanese as you type. It only provides a means to enter Japanese text from an English QWERTY keyboard, so you will still need to know the language in order to use it.
Switching between languages
By default, Ctrl + Space switches through languages in the order they appear in the IBus language menu. To switch to Japanese, Anthy, press Ctrl + Space and the Anthy icon should appear in the panel. Press Ctrl + Space again to return to English.
If more languages are installed, then each press of Ctrl + Space will cycle through the list. You may have as many languages as you like, and if the Ctrl + Space is too time-consuming, you can always click the IBus icon in the panel with the mouse and choose a language from the menu.
The default shortcut can be changed in IBus Preferences.
This is what we have been waiting for! Let’s open a text editor. Here I am using gedit, but any other should work. Practically all programs I have used support any type of language, so there is no need to install special software that accommodates new languages.
Start by typing in English. Switch to the default English input mode, and type, “English.”
Press Enter to start a new line, and this time, switch to Japanese – Anthy by pressing Ctrl + Space. Type “hiragana” using the QWERTY keys. Even though we have switched the input method to Japanese – Anthy, key locations remain the same. (H still maps to the h key, pressing A still maps to a, and so on.)
Underline Indicates the Current Word
Notice the underline when you type? Typing is performed by words. An underline indicates that whatever characters you type will be applied to form a single word. This is necessary because most Hiragana and Katakana (Kana) characters require two or three key presses (ASCII characters) to register a single Kana.
For example, to make か (ka) appear, you must type a “k” and then an “a” on the keyboard. For the word ひらがな, it takes two key presses to form one Kana symbol. So, we type, hi ra ha na (no spaces) to produce ひらがな.
By default, Japanese words are entered as romaji. This requires that you know how to “spell” in Japanese using English keyboard characters.
While we can simply write ひらがな on paper by scribbling the characters directly, on a keyboard, we must type h-i-r-a-g-a-n-a and then press Enter to complete the word.
Pressing Enter says, “I am finished typing this word. Let’s move on to another.”
Notice that pressing Enter makes finishes word entry and removes the underline. It does not begin a new line immediately like it did after we type the word “English.” You must press Enter twice in a row to move to a new line.
Press Enter now, and the cursor will move to a new line.
Switching to Katakana
We will enter Katakana text on this line, but if type now, we will be entering Hiragana characters: かたかな
This is not what we want. Recall the keyboard shortcuts we created? Press Ctrl + k (or whatever shortcut you chose) to switch to Katakana input mode. (You can also choose Katakana from the IBus menu.)
Now, type “katakana” on the keyboard to see the Katakana characters appear: カタカナ. Press Enter to complete the word.
Mixing Hiragana and Katakana Together
Good. Now, press Enter twice (once to complete the word entry and a second time to jump to a new line) to begin a new line. Switch back to Hiragana by pressing Ctrl + h, and type “sono” (that). We are going to write a simple “that cake” in Japanese.
Press Enter to complete the word その, but do not move to a new line. Since the word for “cake” is usually written as ケーキusing Katakana, switch to Katakana mode and type the Japanese word for cake as k-e-HYPHEN-k-i. To produce the dash symbol, press the hyphen key on the keyboard.
Press Enter to complete the word, and we should see そのケーキ
This is how we combine the two Kana in one line.
Ah, Kanji. The 1,945 jouyou Kanji should keep you occupied, and you can type them all from the keyboard…and then some.
During the example above, you might have noticed a dropdown menu that appeared. Especially if you made a few mistakes. If not, then anytime you press the space bar while a Japanese word is underlined, you can view a list of Kanji suggestions.
The Japanese language is filled with homonyms, and this convenience feature allows you to select the appropriate Kanji.
To enter Kanji, you type in romaji as before, but before pressing Enter, press space (or use the arrow keys as a shortcut) to find the Kanji for the word you are typing. Let’s try this with the common word 私.
On a new line in the text editor, type “watashi” (oneself). You should see わたし in Hiragana.
Do not complete the word yet. We want to use the Kanji for わたし, which is 私. Press the space bar. A list of homonyms appears, with the most likely candidate selected by default.
When this Kanji appears in place of the typed Hiragana, press Enter to complete the word.
Let’s combine Hiragana, Katakana, and Kanji in one basic sentence by writing, “This is my cake.” complete with the period, called a maru ( 。) in Japanese. In romaji, we type “kore wa watashi no kēki desu.” (without the spaces) which will look like これは私のケーキです。
Here is a sequence of keyboard actions:
Type kore and press Enter
Type ha and press Enter.
This is the particle “wa,” but to type it, we must type “ha” because typing “wa” produces わ, which is incorrect here. The same applies to the particle を for which we must type “wo,” not “o” lest we get the vowel お.
Be careful with particles. There might be a better way to enter them on a QWERTY keyboard, but I have yet to discover it. For now, type the sequence of characters that make the correct particle appear.
Type watashi, press space, and then press Enter. The same as before.
Type no, and press Enter.
Another particle showing possession in this case. We can type this one as it is.
Ctrl + k (switch to katakana), type ke-HYPHEN-ki, and then press Enter.
Ctrl + h (switch to Hiragana mode), type desu, type a period, and then press Enter.
A period produces the maru symbol （ 。）. The following illustration might help explain the text entry process better.
Another Practice Sentence
Are you having fun switching between input modes? Let’s try something trickier by using a longer sentence and combining English. We are going to write この本は面白そうでわありません。and on the same line, provide the English translation, “This book doesn’t look interesting.”
This is easier since it consists of hiragana with a few Kanji. The point to note is that to switch to English, press Ctrl + Space after the maru ( 。) and begin typing in English.
In case of typos, it’s usually fine to use backspace while entering Kana. Anthy is intelligent enough to work with the mistakes, but it’s not perfect. Sometimes, you might need to delete the entire word and begin anew.
“What can I do with this?”
Anything that accepts text entry, whether it be a text editor, filename, a terminal command prompt, filenames in a file manager, or search bars in web sites, for example, can receive Japanese text. You can even mix and match English and Japanese in the same text by switching input methods.
Here are a few examples.
Japanese Internet Search
Suppose you wish to browse a Japanese site, such as amazon.co.jp, and search for a product. In the Amazon search bar, you could enter 自転車 (jitensha = bicycle) to look for bicycles.
This allows you to search directly in Japanese by typing in Japanese. Entering English text might return unwanted results.
Perhaps you wish to search Google for Japanese movie dramas. Even though Google open with English (assuming you are connecting with an English-language user agent from an English-region IP address), once you enter something like 動画ドラマ (douga dorama = movie drama), Google will return Japanese links in Japanese text.
Folders and Filenames
In a file manager, you can give new names to files and folders you create.
Here is a directory containing two subdirectories and two files. All were named by selecting Create New Folder and Create New Document from the Nemo context menu. Names were entered by switching to Japanese – Anthy and entering Katakana and Kanji.
Mixing English and Kanji in Paths
Did you notice the path in the location bar above? The directory is named 漢字 located in /tmp. The absolute path is /tmp/漢字, so we see a mix of English and Kanji. The is perfectly allowed. We must use this to access it in a terminal.
This leads to more typing due to switching input methods, so one language is probably more convenient for paths.
You can write emails in Japanese. While the subject and body may be any mix of English and Japanese text, the email addresses must be in ASCII.
For those using email encryption, such as GPG and EnigMail, Japanese body text encrypts fine just like any other text. Keep in mind that the destination computer must contain Japanese language display support with the needed fonts. Sending Japanese text will not make it magically appear on your friend’s computer if his system only supports ASCII.
This should not be much of an issue with today’s modern systems, but if you receive a reply to the effect of, “I couldn’t read the email you sent because it showed numbers and other random garbage characters,” then missing fonts and Japanese support could be the reason.
However, if he cannot read Japanese and the Kana look like gibberish to him, then that is another matter entirely that no computer can resolve.
IBus and the Japanese language packs need not be installed on the recipient Linux systems due to excellent UTF-8 support in today’s Linux. In my tests, every Linux system that received a Japanese email was able to display the Kanji and Kana characters without IBus or the Japanese language pack present. However, composing emails does require IBus and the Japanese language pack.
Be Careful With Passwords
When Linux prompts you to log in or enter passwords, such as when using sudo, take note of which input method is currently selected. If you are in the wrong mode, then Linux will reject the login and password information entered. Use the input method you installed Linux with and all should be well. If you find yourself wondering why your password no longer works despite entering it properly several times in a row, then this could be the reason.
Some of us live almost exclusively in one language, so it is easy to ask, “Why bother learning how to install additional language support?” But when we find situations where we need to communicate with people from other countries via email, web sites, forums, or other message formats, then knowing how to type in the target language when limited to a QWERTY keyboard becomes vital.
Have fun, and learn a new language in the process!
Entering Japanese Text (or any other language) in Ubuntu 10.10 (Older article)