Difference between revisions of "Languages"
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Linux]] | [[Category:Linux]] | ||
+ | |||
+ | On this page you'll find how to: | ||
+ | * Setup languages fonts | ||
+ | * Display different languages | ||
+ | * Input in different languages (chinese, swedish, french...) | ||
+ | |||
+ | |||
+ | |||
+ | |||
=Fonts= | =Fonts= | ||
− | == | + | ==European / common fonts== |
+ | |||
+ | <syntaxhighlight lang="bash"> | ||
+ | apt-get install xfonts-intl-european xfonts-intl-phonetic | ||
+ | apt-get install mathematica-fonts | ||
+ | apt-get install ttf-mscorefonts-installer | ||
+ | apt-get install fontypython ttf-opensymbol | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | ==Asian fonts== | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install xfonts-intl-asian xfonts-intl-chinese xfonts-intl- | + | apt-get install xfonts-intl-asian xfonts-intl-chinese xfonts-intl-chinese-big |
+ | apt-get install pinyin-database sunpinyin-utils libpinyin-utils | ||
+ | apt-get install fonts-arphic-ukai fonts-arphic-uming | ||
+ | apt-get install fonts-arphic-* | ||
+ | # See https://en.wikipedia.org/wiki/WenQuanYi | ||
+ | apt-get install fonts-wqy-zenhei fonts-wqy-microhei xfonts-wqy | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | * More info on PinYin Joe: http://www.pinyinjoe.com/index.html | ||
+ | * More fonts on: http://cooltext.com/Download-Font-%E7%B2%97%E6%A5%B7%E4%BD%93%E7%AE%80+Kai+Bold | ||
− | == | + | ==Android / Google fonts== |
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install | + | apt-get install fonts-droid-fallback fonts-roboto fonts-roboto-hinted |
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | ==Printing fonts== | ||
Full set of printing fonts: | Full set of printing fonts: | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install texlive-fonts-recommended texlive-fonts-extra | + | apt-get install texlive-fonts-recommended texlive-fonts-extra texlive-lang-chinese texlive-lang-french texlive-lang-english |
</syntaxhighlight> | </syntaxhighlight> | ||
− | !! Warning this required about | + | |
+ | !! Warning this required about 900 Mb !! | ||
− | == | + | |
+ | =Support many languages (locales)= | ||
+ | |||
+ | ==Installation== | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install | + | apt-get install locales |
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | ==Configuration (1)== |
+ | |||
+ | * Search for your language locale's String | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | # replace FR by your own language code (zh, de, sv, ...) | |
+ | less /usr/share/i18n/SUPPORTED | grep fr | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | Create / edit the configuration file | |
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | vim /var/lib/locales/supported.d/local | |
− | + | ||
− | + | # Example of many languages combination: | |
− | + | en_US.UTF-8 UTF-8 | |
+ | fr_FR.UTF-8 UTF-8 | ||
+ | de_DE.UTF-8 UTF-8 | ||
+ | sv_SE.UTF-8 UTF-8 | ||
+ | zh_CN.UTF-8 UTF-8 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ==Configuration (2)== | |
+ | Regenerate system languages | ||
− | = | + | <syntaxhighlight lang="bash"> |
+ | dpkg-reconfigure locales | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | Check result: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | locale -a | |
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | (i) '''You need to restart''' your server before using the new languages. | ||
+ | =Inputs manager= | ||
+ | Depending on your Linux distribution and version you might be interested by: | ||
+ | * IBUS - old input manager, still efficient. Default on most distribution until 2015 | ||
+ | * FCITX - new input manager, new standard since 2015. | ||
− | |||
− | == | + | ==FCITX (Ubuntu >= 16)== |
+ | |||
+ | ===Installation=== | ||
+ | |||
+ | Input methods: | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install | + | apt-get install fcitx |
+ | apt-get install fcitx-libs fcitx-table-emoji fcitx-table-easy-big | ||
+ | |||
+ | # Pinyin = chinese chars. encoded in standard GB | ||
+ | # SunPinYin = OpenSource project, official pinyin support for Linux | ||
+ | # Google PinYin = Same PinYin as Android | ||
+ | # CheWing = MS Windows PinYin | ||
+ | apt-get install fcitx-pinyin fcitx-sunpinyin fcitx-googlepinyin fcitx-chewing | ||
+ | |||
+ | # Japanese input | ||
+ | apt-get install fcitx-anthy | ||
+ | |||
+ | # Display pinyin input menu (list of characters) -> qimpanel does NOT work well on XCFE. Better remove it and switch to the 'classic' UI | ||
+ | apt-get remove --purge fcitx-ui-qimpanel | ||
+ | apt-get install fcitx-ui-classic fcitx-ui-light | ||
+ | |||
+ | # Keyboard support for Mozilla Firefox and other applications | ||
+ | apt-get install fcitx-mozc | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
+ | Language selector: | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install | + | apt-get install im-config |
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | |
+ | ===FCITX as default input manager=== | ||
+ | |||
+ | '''Language support''' | ||
+ | |||
+ | * Go to '''Preferences''' > '''Language support''' | ||
+ | * Install required languages (French, Chinese, English, ...) | ||
+ | * Select input method ''fcitx'' | ||
+ | |||
+ | [[File:Language selection 1.png|400px|Language Support]] | ||
+ | |||
+ | * Confirm! | ||
+ | |||
+ | |||
+ | |||
+ | '''IM-Config''' | ||
+ | |||
+ | Sometimes the 1st step is not enough. You need to run ''im-config'' as well. | ||
+ | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | # run as a user | |
+ | im-config | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | * Click OK on the 1st screen | ||
+ | * Click ''YES'' on the 2nd screen to explicitly set the language input manager | ||
− | + | [[File:Language selection 2.png|550px|IM-Config #1]] | |
− | * | + | * Choose FCITX on the new screen and valid |
− | |||
+ | [[File:Language selection 3.png|550px|IM-Config #2]] | ||
+ | * Confirm! | ||
− | |||
− | + | '''Remove conflict''' | |
+ | Run the next step before you log-off / log-in and use FCITX as your default input manager. | ||
+ | There is a bug in the default configuration that prevent the display of PinYin characters table. | ||
− | = | + | ===BugFix: PinYin table doesn't appear=== |
− | + | By default on the ''language support'' step Ubuntu force the installation of a crappy package ''fcitx-ui-qimpanel''. You must remove it: | |
− | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | apt-get install | + | # Display pinyin input menu (list of characters) -> qimpanel does NOT work well on XCFE. Better remove it and switch to the 'classic' UI |
+ | apt-get remove --purge fcitx-ui-qimpanel | ||
+ | apt-get install fcitx-ui-classic fcitx-ui-light | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | After installation you must log-off / log-in | ||
− | == | + | ===Usage=== |
− | + | Once you re-log yourself you should see a FCITX option on the toolbar (close to the clock). | |
− | |||
− | |||
− | |||
− | + | * Click on FCITX toolbar > '''configure input method''' | |
− | * | + | * Add new languages and input method as follow: |
− | * | + | ** Click on ADD input |
− | * | ||
− | * | ||
+ | [[File:Language selection 4.png|550px|FCITX config #1]] | ||
+ | ** Un-tick the check box to display ALL languages ; search for the input you'd like to add. (i) Chinese input are at the bottom | ||
+ | [[File:Language selection 5.png|550px|FCITX config #2]] | ||
− | + | ===Set the shortcuts=== | |
− | |||
− | |||
− | |||
− | + | You should set some shortcuts to switch between languages - in case the UI doesn't work very well (like in Xubuntu 16.10). | |
+ | * Go to '''Settings''' | ||
+ | * Go to '''Keyboard''' | ||
+ | [[File:Fcitx shortcuts.png|500px|FCITX shortcuts]] | ||
− | + | If you want to change the keyboard yourself: | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | # Simplified Chinese | |
+ | fcitx-remote -s pinyin | ||
+ | # Google Chinese (simplified) | ||
+ | fcitx-remote -s googlepinyin | ||
− | # | + | # French |
− | + | fcitx-remote -s fcitx-keyboard-fr-oss | |
− | + | # Swedish | |
− | + | fcitx-remote -s fcitx-keyboard-se | |
+ | # German | ||
+ | fcitx-remote -s fcitx-keyboard-de | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | Done! | ||
+ | |||
+ | You can use PinYin or any other input you'd like! | ||
− | + | ==Input manager IBUS (Ubuntu < 16)== | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | apt-get install ibus | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ==Chinese PinYin== | |
− | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | apt-get install ibus-pinyin ibus-sunpinyin ibus-googlepinyin | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ==Input configuration== | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | ibus-setup | |
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | Set Ibus as default: | ||
+ | |||
+ | * System Menu -> System Settings -> Language Support and set the "Keyboard Input Method" to "ibus" | ||
+ | * Then log out and back in again. | ||
+ | |||
+ | |||
+ | |||
+ | =Sources= | ||
+ | |||
+ | It took me many hours to find and compile all the current information. PinYin Joe is an excellent base to start with: | ||
+ | * installation # 1 http://www.pinyinjoe.com/linux/ubuntu-12-chinese-setup.htm | ||
+ | * installation # 2 http://www.pinyinjoe.com/pinyin/3rdpartyapps.htm#googlepinyin | ||
+ | * Chinese fonts # http://www.pinyinjoe.com/linux/ubuntu-10-chinese-fonts-openoffice-language-features.htm |
Latest revision as of 21:48, 13 December 2016
On this page you'll find how to:
- Setup languages fonts
- Display different languages
- Input in different languages (chinese, swedish, french...)
Fonts
European / common fonts
apt-get install xfonts-intl-european xfonts-intl-phonetic
apt-get install mathematica-fonts
apt-get install ttf-mscorefonts-installer
apt-get install fontypython ttf-opensymbol
Asian fonts
apt-get install xfonts-intl-asian xfonts-intl-chinese xfonts-intl-chinese-big
apt-get install pinyin-database sunpinyin-utils libpinyin-utils
apt-get install fonts-arphic-ukai fonts-arphic-uming
apt-get install fonts-arphic-*
# See https://en.wikipedia.org/wiki/WenQuanYi
apt-get install fonts-wqy-zenhei fonts-wqy-microhei xfonts-wqy
- More info on PinYin Joe: http://www.pinyinjoe.com/index.html
- More fonts on: http://cooltext.com/Download-Font-%E7%B2%97%E6%A5%B7%E4%BD%93%E7%AE%80+Kai+Bold
Android / Google fonts
apt-get install fonts-droid-fallback fonts-roboto fonts-roboto-hinted
Printing fonts
Full set of printing fonts:
apt-get install texlive-fonts-recommended texlive-fonts-extra texlive-lang-chinese texlive-lang-french texlive-lang-english
!! Warning this required about 900 Mb !!
Support many languages (locales)
Installation
apt-get install locales
Configuration (1)
- Search for your language locale's String
# replace FR by your own language code (zh, de, sv, ...)
less /usr/share/i18n/SUPPORTED | grep fr
Create / edit the configuration file
vim /var/lib/locales/supported.d/local
# Example of many languages combination:
en_US.UTF-8 UTF-8
fr_FR.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
sv_SE.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
Configuration (2)
Regenerate system languages
dpkg-reconfigure locales
Check result:
locale -a
(i) You need to restart your server before using the new languages.
Inputs manager
Depending on your Linux distribution and version you might be interested by:
- IBUS - old input manager, still efficient. Default on most distribution until 2015
- FCITX - new input manager, new standard since 2015.
FCITX (Ubuntu >= 16)
Installation
Input methods:
apt-get install fcitx
apt-get install fcitx-libs fcitx-table-emoji fcitx-table-easy-big
# Pinyin = chinese chars. encoded in standard GB
# SunPinYin = OpenSource project, official pinyin support for Linux
# Google PinYin = Same PinYin as Android
# CheWing = MS Windows PinYin
apt-get install fcitx-pinyin fcitx-sunpinyin fcitx-googlepinyin fcitx-chewing
# Japanese input
apt-get install fcitx-anthy
# Display pinyin input menu (list of characters) -> qimpanel does NOT work well on XCFE. Better remove it and switch to the 'classic' UI
apt-get remove --purge fcitx-ui-qimpanel
apt-get install fcitx-ui-classic fcitx-ui-light
# Keyboard support for Mozilla Firefox and other applications
apt-get install fcitx-mozc
Language selector:
apt-get install im-config
FCITX as default input manager
Language support
- Go to Preferences > Language support
- Install required languages (French, Chinese, English, ...)
- Select input method fcitx
- Confirm!
IM-Config
Sometimes the 1st step is not enough. You need to run im-config as well.
# run as a user
im-config
- Click OK on the 1st screen
- Click YES on the 2nd screen to explicitly set the language input manager
- Choose FCITX on the new screen and valid
- Confirm!
Remove conflict
Run the next step before you log-off / log-in and use FCITX as your default input manager. There is a bug in the default configuration that prevent the display of PinYin characters table.
BugFix: PinYin table doesn't appear
By default on the language support step Ubuntu force the installation of a crappy package fcitx-ui-qimpanel. You must remove it:
# Display pinyin input menu (list of characters) -> qimpanel does NOT work well on XCFE. Better remove it and switch to the 'classic' UI
apt-get remove --purge fcitx-ui-qimpanel
apt-get install fcitx-ui-classic fcitx-ui-light
After installation you must log-off / log-in
Usage
Once you re-log yourself you should see a FCITX option on the toolbar (close to the clock).
- Click on FCITX toolbar > configure input method
- Add new languages and input method as follow:
- Click on ADD input
- Un-tick the check box to display ALL languages ; search for the input you'd like to add. (i) Chinese input are at the bottom
Set the shortcuts
You should set some shortcuts to switch between languages - in case the UI doesn't work very well (like in Xubuntu 16.10).
- Go to Settings
- Go to Keyboard
If you want to change the keyboard yourself:
# Simplified Chinese
fcitx-remote -s pinyin
# Google Chinese (simplified)
fcitx-remote -s googlepinyin
# French
fcitx-remote -s fcitx-keyboard-fr-oss
# Swedish
fcitx-remote -s fcitx-keyboard-se
# German
fcitx-remote -s fcitx-keyboard-de
Done!
You can use PinYin or any other input you'd like!
Input manager IBUS (Ubuntu < 16)
apt-get install ibus
Chinese PinYin
apt-get install ibus-pinyin ibus-sunpinyin ibus-googlepinyin
Input configuration
ibus-setup
Set Ibus as default:
- System Menu -> System Settings -> Language Support and set the "Keyboard Input Method" to "ibus"
- Then log out and back in again.
Sources
It took me many hours to find and compile all the current information. PinYin Joe is an excellent base to start with:
- installation # 1 http://www.pinyinjoe.com/linux/ubuntu-12-chinese-setup.htm
- installation # 2 http://www.pinyinjoe.com/pinyin/3rdpartyapps.htm#googlepinyin
- Chinese fonts # http://www.pinyinjoe.com/linux/ubuntu-10-chinese-fonts-openoffice-language-features.htm