Difference between revisions of "Languages"

(Add new / manage languages (locales))
Line 1: Line 1:
 
[[Category:Linux]]
 
[[Category:Linux]]
=Fonts=
 
 
==Main fonts==
 
<syntaxhighlight lang="bash">
 
apt-get install xfonts-intl-asian xfonts-intl-chinese xfonts-intl-european xfonts-intl-phonetic
 
</syntaxhighlight>
 
  
 +
On this page you'll find how to:
 +
* Display different languages
 +
* Input in different languages (chinese, swedish, french...)
  
==Printing fonts==
 
<syntaxhighlight lang="bash">
 
apt-get install fontypython ttf-opensymbol
 
</syntaxhighlight>
 
  
Full set of printing fonts:
 
<syntaxhighlight lang="bash">
 
apt-get install texlive-fonts-recommended texlive-fonts-extra
 
</syntaxhighlight>
 
!! Warning this required about 800 Mb !!
 
  
  
==Mathematics==
+
=Fonts=
<syntaxhighlight lang="bash">
 
apt-get install mathematica-fonts
 
</syntaxhighlight>
 
  
 +
==European / common fonts==
  
==Microsoft fonts==
 
 
<syntaxhighlight lang="bash">
 
<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 ttf-mscorefonts-installer
 +
apt-get install fontypython ttf-opensymbol
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
==Chinese fonts==
+
==Asian fonts==
 +
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 +
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-ukai fonts-arphic-uming
 
apt-get install fonts-arphic-*
 
apt-get install fonts-arphic-*
Line 40: Line 31:
 
</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">
 +
apt-get install fonts-droid-fallback fonts-roboto fonts-roboto-hinted
 +
</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
+
==Printing fonts==
  
==Android fonts==
+
Full set of printing fonts:
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install fonts-droid-fallback fonts-roboto
+
apt-get install texlive-fonts-recommended texlive-fonts-extra texlive-lang-chinese texlive-lang-french texlive-lang-english
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=Alternative inputs=
+
!! Warning this required about 900 Mb !!
  
==Input manager FCITX (Ubuntu >= 16)==
 
  
Since Ubuntu 16.04 there is a new input manager: FCITX
 
  
 +
=Support many languages (locales)=
  
'''Installation'''
+
==Installation==
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
apt-get install fcitx fcitx-pinyin fcitx-sunpinyin fcitx-googlepinyin fcitx-anthy fcitx-mozc fcitx-libpinyin fcitx-libs fcitx-table-emoji fcitx-table-easy-big
+
apt-get install locales
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
'''Activation'''
+
==Configuration (1)==
 +
 
 +
* Search for your language locale's String
  
Run the following command as an user (not root):
 
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
im-config
+
# replace FR by your own language code (zh, de, sv, ...)
 +
less /usr/share/i18n/SUPPORTED | grep fr
 
</syntaxhighlight>
 
</syntaxhighlight>
  
  
More info on: http://www.pinyinjoe.com/linux/ubuntu-12-chinese-setup.htm
+
Create / edit the configuration file
 +
 
 +
<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>
 +
 
  
 +
==Configuration (2)==
  
 +
Regenerate system languages
  
==Input manager IBUS (Ubuntu < 16)==
 
 
<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.
  
==Add new language==
 
  
Search for your language [replace ''fr'' by your own language like ''zh'' or ''sv''...]
+
 
 +
===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">
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
 
* de_DE.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
  
Add the new language to the list of the local languages
+
[[File:Language selection 4.png|550px|FCITX config #1]]
<syntaxhighlight lang="bash">
 
echo "fr_FR.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local
 
</syntaxhighlight>
 
  
[!] The key '''fr_FR.UTF-8 UTF-8''' must match an entry in the ''SUPPORTED'' file !!
+
** 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]]
  
  
[alternative] you can directly edit the file:
+
Done!
<syntaxhighlight lang="bash">
 
vim /var/lib/locales/supported.d/local
 
  
# You should have:
+
You can use PinYin or any other input you'd like!
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>
 
  
  
  
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.

Revision as of 17:03, 24 April 2016


On this page you'll find how to:

  • 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


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.