Input chinese in linux

Ubuntu 22.04 Chinese (simplified) pinyin input support

There are well over a decade’s worth of mutually incompatible instructions for setting up basic pinyin input on previous versions of Ubuntu. People make lots of claims about needing to do now obsolete rubbish, which means that many people (including me) end up spending many hours only to end up with a broken install. Is there a simple procedure to set up Chinese pinyin input for simplified characters that doesn’t require many hours of trial and error and leave the system half broken?

2 Answers 2

Note: These instructions are ONLY meant for vanilla Ubuntu and ONLY for 22.04 for basic pinyin input for simplified characters.

Ubuntu has never provided an easy, well-documented option for adding pinyin input support. However, to get basic pinyin support in 22.04 you can simply:

  1. Open Settings, go to Region & Language -> Manage Installed Languages -> Install / Remove languages .
  2. Select Chinese (Simplified) . Make sure Keyboard Input method system has Ibus selected. Apply.
  3. Reboot
  4. Log back in, reopen Settings, go to Keyboard .
  5. Click on the «+» sign under Input sources .
  6. Select Chinese (China) and then Chinese (Intelligent Pinyin) .

You should now have a little «en» (or whatever the language code of your Ubuntu install is) at the top right of your main screen which you can click on and get a list of available input methods, including Chinese (Intelligent pinyin) . Open anything that can receive text (like gedit, openoffice, vim, FF. ) and try it out. You can also change between them with Super/Win + space .

  1. Reboot to make sure it is still there after a reboot.
  2. Be happy that you didn’t lose any more time on this ridiculously trivial issue that is still a massive pain in 2022!

If you don’t need extra bells and whistles then do NOT bother with fcitx (and the supposedly excellent «google pinyin»), uim or any other exotic option! They are extremely hit-and-miss trying to install, and finding a guide that is relevant to 22.04 is almost impossible. Some claim to have «tested with 22.04» but they have done upgrades of previous versions that they had working, not fresh installs.

Источник

Install and Configure Rime [1][2] for iBus

It is a known issue since GNOME 3.28 to 3.34 (Ubuntu 18.04, 18.10, 19.10) [4] [5][6] .

Читайте также:  Linux low level formatting

To customize displayed candidates, look for “page_size: 5” in “~/.config/ibus/rime/build/default.yaml”. Only 1 to 9 is allowed. MUST have a space between the colon and the number.

If the “~/.config/ibus/rime/build/luna_pinyin.schema.yaml ” exists, the “page_size” setting would overwrite the defaul in luna pinyin(朙月拼音). Edit the “luna_pinyin.schema.yaml” instead.

On 2020/6/23, iBus has no problems with OneNote but the input and candidates are both invisible in GoogleDoc.

Install and Configure Pinyin [7] for iBus

  1. Search for “ibus pinyin” in “Ubuntu Software”.
  2. Install the one from the developer: “ubuntu-bionic-updates-main”.
  3. Reboot or logout then login again.
  4. “Settings” → “Region & Language” → Add an input source by searching “pinyin” and select “Others” → “Chinese(Intelligent Pinyin)”.

More Pinyin settings, select and click on the gear icon:

Pinyin for iBus Preferences

  • If both Rime and Pinyin are installed, use [Super] + [Space] and hold for a half-second will display a list of all available input sources. Or it would switch between the selected Chinese input method and English immediately.
  • Once installed, it cannot be removed by “Ubuntu Software”. It could be removed from the “Input Sources” list in “Settings”.
  • It is based on libpinyin which uses a more advanced algorithm (2-gram vs libgooglepinyin’s unigram) and supports more features [8] than Google Pinyin.

Install and Configure Google Pinyin for iBus [9]

The latest update is 2013/10/18 as checked on 2020/4/23. “ibus-googlepinyin” is not found using the apt-get command.

It is suggested to use the variation. [10] Both are based on libgooglepinyin.

Install and Configure Rime for Fcitx [11]

$sudo apt-get update $sudo apt-get install fcitx fcitx-rime

After installation, change the input method: [13]

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” as the “user configuration”.
  3. Reboot.
  4. “Settings” → “Region & Language” → “Manage Installed Languages”.
  5. “Fcitx” should be selected in the “Keyboard input method system”.
  6. Click on Fcitx’s icon on top, “Configure” → “+” in the “Input Method” tab → Disable “Only Show Current Language” → Add an input method by searching “rime” and select “Rime”.
  7. Make sure the accelerator in the “Trigger Input Method” in the “Global Config” tab is assigned. It must be different from the “Switch to next input source” in the GNOME Control Center (“Settings” → “Devices” → “Keyboard”) which is used by IBus.

To customize displayed candidates, look for “page_size: 5” in “~/.config/fcitx/rime/build/default.yaml”. Only 1 to 9 is allowed. MUST have a space between the colon and the number.

If the “~/.config/fcitx/rime/build/luna_pinyin.schema.yaml ” exists, the “page_size” setting would overwrite the defaul in luna pinyin(朙月拼音). Edit the “luna_pinyin.schema.yaml” instead.

To change the background color of the candidate area, open the “Input Method Configuration” dialog in step 6. In the “Appearance” tab, enable the “Show Advanced Options” and manually set the “Skin Name” to ‘dark’. Selecting “skin/dark/fcitx_skin.conf” in the “Skin” list doesn’t work.

Читайте также:  Doctor web для linux

On 2020/6/23, Fcitx has no problems with GoogleDoc but sometimes a double entry in OneNote or crash.

Install and Configure Google Pinyin for Fcitx

The latest update is 2020/3/23 as checked on 2020/4/23. To use it, I also need to switch from iBus to Fcitx [12] input method framework.

$sudo apt-get update $sudo apt-get install fcitx fcitx-googlepinyin

After installation, change the input method: [13]

Acclerators are Unique

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” as the “user configuration”.
  3. Reboot.
  4. “Settings” → “Region & Language” → “Manage Installed Languages”.
  5. “Fcitx” should be selected in the “Keyboard input method system”.
  6. Click on Fcitx’s icon on top, “Configure” → “+” in the “Input Method” tab → Disable “Only Show Current Language” → Add an input method by searching “google” and select “Google Pinyin”.
  7. Make sure the accelerator in the “Trigger Input Method” in the “Global Config” tab is assigned. It must be different from the “Switch to next input source” in the GNOME Control Center (“Settings” → “Devices” → “Keyboard”).

To switch between the default Simplified Chinese and Traditional Chinese, use [Ctrl] + [Shift] +[F] . It can be configured in the “Simplified Chinese to Traditional Chinese” in the “Addon” tab in Fcitx: [14]

Simplified Chinese to Traditional Chinese

Remove Google Pinyin for Fcitx and Restore Rime for iBus

$sudo apt-get remove fcitx fcitx-googlepinyin $sudo apt-get autoremove $sudo apt-get install ibus ibus-rime

After installation, restore Rime for iBus:

  1. Reboot or logout then login again.
  2. “Settings” → “Region & Language” → “Manage Installed Languages”.
  3. “iBus” should be selected in the “Keyboard input method system”.
  4. Reboot. Logout then login again won’t be able to use Rime to input Chinese.

If the GNOME Control Center is lost, reinstall by: [15]

$sudo apt-get update $sudo apt-get install gnome-control-center
  • If Ubuntu use Unity instead of GNOME, install “unity-control-center” instead. [16]
  • While removing “im-config”, “gnome-control-center” is removed, too.

Switch Between iBus and Fcitx

To switch among different input method framework, use im-config.

  1. Run the command: $im-config. If it is not available, run “$sudo apt-get install im-config” to install.
  2. Select “fcitx” or “iBus” as the “user configuration”.
  3. Reboot.

Issues

Cannot Switch Back to Chinese from English Mode in Rime

While using Rime with Fcitx, I notice it was in English mode with unknown accelerator. I cannot use [Shift] to switch back to Chinese mode.

The only solution is to hit the [F4] for [方案選單]. Use [2. 西/半/漢/。]→[2. 西文→中文] to switch to Chinese mode.

Reference

  1. RIME | 中州韻輸入法引擎:下載及安裝
  2. GitHub: RIME: RimeWithIBus
  3. GitHub: RIME: CustomizationGuide
  4. GNOME: Delay on keyboard layout switching
  5. AskUbuntu: iBus on busy system
  6. LaunchPad: Delay before you can type after switching input source
  7. GitHube: libpinyin: ibus-libpinyin
  8. Google Code: libgooglepinyin
  9. Ubuntu: ibus-googlepinyin package
  10. AskUbuntu: How can I find ibus-googlepinyin?
  11. Ubuntu: fcitx-googlepinyin package
  12. Fcitx
  13. ubuntu安装Google输入法
  14. Ubuntu 修改 谷歌输入法 简繁体切换的快捷键
  15. AskUbuntu: Restore Missing “Settings” (gnome-control-center) Icon in Ubuntu 18.04
  16. AskUbuntu: Missing System Settings after removing some packages
Читайте также:  Поднимаем файловый сервер linux

Share this:

Источник

Input chinese in linux

How to input Chinese characters in gnome

Writing in Pinyin

Pinyin is the transcription of the spoken Chinese language in Latin characters. Each character has a tone which can be entered via the keyboard’s various layers. E.g. on a German keyboard, buttons for ‘ and ` are available which allows to write the second (e.g. má) and fourth tone (e.g. mà). The first tone can be composed by holding + + then the character (e.g. mā), the third by + + then the character (e.g. mǎ).

Fonts

using ibus

ibus is a DBus-based daemon which supports different input method modules (IMmodules) and integrates well with e.g. KDE 4, GNOME. The documentation can be found at I18n/ibus

using UIM

  • Install the packages uimlibuim0uim-commonuim-gtk2.0 uim-primeuim-utils
  • Exit from Package manager, close all windows
  • restart gdm :
su cd /etc/init.d ./gdm restart

Setup

Start uim-pref-gtk (type this in a terminal window)

change the setting for selection of chinese input from -Space to -Shift (-Shift did not work)

Usage

Change over to chinese input with -Shift Select an alternate chinese character with -N

To edit and enter Pinyin, add all vowels into the character palette: áéíóúàèìòùāēĩōūăĕĭŏŭǚ

using SCIM

Setup

The file README.Debian in /usr/share/doc/scim contains the necessary documentation.

To convert pinyin into Chinese, also add scim-pinyin. Gnome-Users should also add scim-gtk2-immodule to make use of the the GTK IM (GTK input method).

If you are not using an US-English keyboard, your keyboard has to be defined in file ~/.scim/global. If that file does not exist, start scim in a terminal and terminate with Ctrl-C. Check you locale LANG with the terminal command locale, for German it is e.g. de_DE.utf8. Add the line /SupportedUnicodeLocales = to that file.

If there are many users on a system and use the same locale, you may want to consider changing the system configuration file /etc/scim/global to set the supported locale.

Usage

Just start a GTK+/GNOME program, right-click somewhere on an input field and choose "Input Methods -> SCIM Input Method" in the pop-up menu, and SCIM should automatically start if it's not started yet. Now pressing Ctrl-space should also activate SCIM and show a toolbar. You can start typing and suggestions are being made. There are alternative ways described in the documentation mentioned above.

using Fcitx

You can do this with dpkg-reconfigure:

su # dpkg-reconfigure locales
su # apt-get install fcitx fcitx-sunpinyin fcitx-libpinyin

Use in GNOME

To make fcitx work inside GNOME environment you will need to remove all the input sources from gnome-control-center, clear all the hotkeys for input methods and issue the following command to disable iBus integration:

gsettings set org.gnome.settings-daemon.plugins.keyboard active false

Источник

Оцените статью
Adblock
detector