Difference between revisions of "Languages"

 
(11 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=
  
==Main 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-european xfonts-intl-phonetic
+
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==
  
==Printing fonts==
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install fontypython ttf-opensymbol
+
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 800 Mb !!
 
  
 +
!! Warning this required about 900 Mb !!
 +
 +
 +
 +
=Support many languages (locales)=
 +
 +
==Installation==
  
==Mathematics==
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install mathematica-fonts
+
apt-get install locales
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
==Microsoft fonts==
+
==Configuration (1)==
 +
 
 +
* Search for your language locale's String
 +
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install ttf-mscorefonts-installer
+
# replace FR by your own language code (zh, de, sv, ...)
 +
less /usr/share/i18n/SUPPORTED | grep fr
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
==Chinese fonts==
+
Create / edit the configuration file
 +
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install fonts-arphic-ukai fonts-arphic-uming
+
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)==
  
=Alternative inputs=
+
Regenerate system languages
  
==Input manager IBUS==
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install ibus
+
dpkg-reconfigure locales
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==Chinese PinYin==
+
 
 +
Check result:
 +
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install ibus-pinyin ibus-googlepinyin
+
locale -a
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
==Input configuration==
+
(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">
ibus-setup
+
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>
  
  
Set Ibus as default:
+
Language selector:  
 +
 
 +
<syntaxhighlight lang="bash">
 +
apt-get install im-config
 +
</syntaxhighlight>
  
* System Menu -> System Settings -> Language Support and set the "Keyboard Input Method" to "ibus"
 
* Then log out and back in again.
 
  
  
 +
===FCITX as default input manager===
  
=Xubuntu languages=
+
'''Language support'''
  
* System Menu -> System Settings -> 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!
  
  
=Add new / manage languages (locales)=
 
  
 +
'''IM-Config'''
  
==Requirement==
+
Sometimes the 1st step is not enough. You need to run ''im-config'' as well.
  
Install languages manager
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install locales
+
# 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===
  
  
==Add new language==
+
By default on the ''language support'' step Ubuntu force the installation of a crappy package ''fcitx-ui-qimpanel''. You must remove it:
  
Search for your language [replace ''fr'' by your own language like ''zh'' or ''sv''...]
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
less /usr/share/i18n/SUPPORTED | grep fr
+
# 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>
  
!! Always take the UTF-8 + ISO values !! Examples:
+
After installation you must log-off / log-in
* en_GB.UTF-8 UTF-8
+
 
* fr_FR.UTF-8 UTF-8
 
* sv_SE.UTF-8 UTF-8
 
* zh_CN.UTF-8 UTF-8
 
  
 +
===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]]
  
Add the new language to the list of the local languages
+
** 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
<syntaxhighlight lang="bash">
+
 
echo "fr_FR.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local
+
[[File:Language selection 5.png|550px|FCITX config #2]]
</syntaxhighlight>
+
 
 +
 
 +
===Set the shortcuts===
  
[!] The key '''fr_FR.UTF-8 UTF-8''' must match an entry in the ''SUPPORTED'' file !!
+
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]]
  
[alternative] you can directly edit the file:
+
If you want to change the keyboard yourself:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
vim /var/lib/locales/supported.d/local
+
# Simplified Chinese
 +
fcitx-remote -s pinyin
 +
# Google Chinese (simplified)
 +
fcitx-remote -s googlepinyin
  
# You should have:
+
# French
en_US.UTF-8 UTF-8
+
fcitx-remote -s fcitx-keyboard-fr-oss
fr_FR.UTF-8 UTF-8
+
# Swedish
sv_SE.UTF-8 UTF-8
+
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!
  
  
  
Regenerate system languages
+
==Input manager IBUS (Ubuntu < 16)==
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
dpkg-reconfigure locales
+
apt-get install ibus
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
+
==Chinese PinYin==
Check result:
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
locale -a
+
apt-get install ibus-pinyin ibus-sunpinyin ibus-googlepinyin
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
You need to restart your services before using the new languages.
+
==Input configuration==
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
service apache2 restart
+
ibus-setup
service zabbix-server restart
 
 
</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


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

Language Support

  • 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

IM-Config #1

  • Choose FCITX on the new screen and valid

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:

# 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

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

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

FCITX shortcuts

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: