The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "Funtoo Linux Localization"
(→Portage Settings: add #) |
Threesixes (talk | contribs) m (update templates) |
||
Line 1: | Line 1: | ||
== Set Default Language == | === Set Default Language === | ||
On Funtoo, there are two configuration files responsible for your language settings: | On Funtoo, there are two configuration files responsible for your language settings: {{f|/etc/locale.gen}} and {{f|/etc/env.d/00basic}}. First file has only en_US.UTF-8 locale enabled. Last one is a default shipped file comes from stage3 and responsible for en_US.UTF-8 locale system-wide. Not recommended to edit. | ||
The following steps will guide you through the process of setting up the default system language, using French Canadian as an example. | The following steps will guide you through the process of setting up the default system language, using French Canadian as an example. | ||
First you will need to edit | First you will need to edit {{f|/etc/locale.gen}}: | ||
{{console|body=# ##i##nano -w /etc/locale.gen}} | |||
# ##i##nano -w /etc/locale.gen | |||
Specify your preferred locale with the accompanying character format (you will mostly want UTF-8): | Specify your preferred locale with the accompanying character format (you will mostly want UTF-8): | ||
{{ | {{note|It is recommended to keep the preconfigured en_US.UTF-8 locale as a fallback.}} | ||
{{file|name=/etc/locale.gen|body= | {{file|name=/etc/locale.gen|body= | ||
en_US.UTF-8 UTF-8 | en_US.UTF-8 UTF-8 | ||
fr_CA.UTF-8 UTF-8 | fr_CA.UTF-8 UTF-8 | ||
}} | }} | ||
To determine an appropriate locale for your system, you should take a look into <code>/usr/share/i18n/SUPPORTED</code> for the default list of supported combinations or check the | To determine an appropriate locale for your system, you should take a look into <code>/usr/share/i18n/SUPPORTED</code> for the default list of supported combinations or check the {{f|/usr/share/i18n/locales/}} directory for a list of valid values. | ||
{{ | {{warning|You are strongly advised to use ''at least one'' UTF-8 locale since some applications may require it.}} | ||
Now, those locales need to be generated: | Now, those locales need to be generated: | ||
{{console|body= | |||
# ##i##locale-gen | # ##i##locale-gen | ||
##g##*##!g## Generating 2 locales (this might take a while) with 1 jobs | ##g##*##!g## Generating 2 locales (this might take a while) with 1 jobs | ||
Line 23: | Line 21: | ||
* (2/2) Generating fr_CA.UTF-8 ... [ ok ] | * (2/2) Generating fr_CA.UTF-8 ... [ ok ] | ||
##g##*##!g## Generation complete | ##g##*##!g## Generation complete | ||
}} | |||
Once done, you can apply your locale settings system-wide. First display all available options: | Once done, you can apply your locale settings system-wide. First display all available options: | ||
{{console|body= | |||
$ ##i##eselect locale list | $ ##i##eselect locale list | ||
##b####g##Available targets for the LANG variable: | ##b####g##Available targets for the LANG variable: | ||
Line 34: | Line 32: | ||
##b##[4]##!b## en_US.utf8 ##bl##* | ##b##[4]##!b## en_US.utf8 ##bl##* | ||
##b##[ ]##!b## (free form) | ##b##[ ]##!b## (free form) | ||
}} | |||
The blue star indicates the current default system locale. You can now change it according your wishes: | The blue star indicates the current default system locale. You can now change it according your wishes: | ||
{{console|body= | |||
# ##i##eselect locale set 3 | # ##i##eselect locale set 3 | ||
Setting LANG to fr_CA.utf8 ... | Setting LANG to fr_CA.utf8 ... | ||
Run ". /etc/profile" to update the variable in your shell. | Run ". /etc/profile" to update the variable in your shell. | ||
}} | |||
Alternatively, you can set the default locale manually. This file should be created first with your prefered editor: | Alternatively, you can set the default locale manually. This file should be created first with your prefered editor: | ||
{{file|name=/etc/env.d/02locale|body=LANG="fr_CA.utf8"}} | {{file|name=/etc/env.d/02locale|body=LANG="fr_CA.utf8"}} | ||
You can verify your actions using: | You can verify your actions using: | ||
{{console|body= | |||
$ ##i##eselect locale show | $ ##i##eselect locale show | ||
##b####g##LANG variable in profile: | ##b####g##LANG variable in profile: | ||
##b##fr_CA.utf8 | ##b##fr_CA.utf8 | ||
}} | |||
For an immediate effect it is required to reload the environment: | For an immediate effect it is required to reload the environment: | ||
{{console|body= | |||
# ##i##env-update && source /etc/profile | # ##i##env-update && source /etc/profile | ||
>>> Regenerating /etc/ld.so.cache... | >>> Regenerating /etc/ld.so.cache... | ||
}} | |||
Congratulations! You have successfully set up your default language on Funtoo. | Congratulations! You have successfully set up your default language on Funtoo. | ||
== Portage Settings == | === Portage Settings === | ||
Portage uses a special variable | Portage uses a special variable {{c|LINGUAS}} that defines what localizations/translations get installed by default. By default, {{c|LINGUAS}} in unset, which will result in ''all'' available localizations being installed by Portage. | ||
It is possible to customize the setting of | It is possible to customize the setting of {{c|LINGUAS}} by setting it in {{f|/etc/make.conf}}: | ||
{{console|body= | |||
# ##i##LINGUAS="en_US zh_CN" | # ##i##LINGUAS="en_US zh_CN" | ||
}} | |||
The | The {{c|LINGUAS}} variable should use spaces between each localization name. | ||
After setting the LINGUAS USE flag you may need to re-emerge some packages: | After setting the LINGUAS USE flag you may need to re-emerge some packages: | ||
{{console|body=###i## emerge --ask --newuse --deep --with-bdeps=y @world}} | |||
# emerge --ask --newuse --deep --with-bdeps=y @world | |||
== Read Your Language == | === Read Your Language === | ||
A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント | A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント | ||
Check if you have your language installed (Chinese) by using the | Check if you have your language installed (Chinese) by using the {{c|fc-list}} command from the {{c|media-libs/fontconfig}} ebuild: | ||
{{console|body= | |||
# ##i##fc-list :lang=zh | # ##i##fc-list :lang=zh | ||
}} | |||
If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually. | If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually. | ||
Line 89: | Line 85: | ||
For Japanese: | For Japanese: | ||
{{console|body= | |||
# ##i##emerge media-fonts/kochi-substitute | # ##i##emerge media-fonts/kochi-substitute | ||
}} | |||
For Chinese: | For Chinese: | ||
{{console|body= | |||
# ##i##emerge media-fonts/arphicfonts | # ##i##emerge media-fonts/arphicfonts | ||
}} | |||
For Korean: | For Korean: | ||
{{console|body= | |||
# ##i##emerge media-fonts/baekmuk-fonts | # ##i##emerge media-fonts/baekmuk-fonts | ||
}} | |||
== Keymap == | === Keymap === | ||
Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit | Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit {{f|/etc/conf.d/keymaps}} and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty. | ||
{{console|body= | |||
# ##i##nano -w /etc/conf.d/keymaps | # ##i##nano -w /etc/conf.d/keymaps | ||
}} | |||
== Input Method == | === Input Method === | ||
ibus is an Intelligent Input Bus for Linux. | ibus is an Intelligent Input Bus for Linux. | ||
{{console|body= | |||
# ##i##emerge -av ibus | # ##i##emerge -av ibus | ||
}} | |||
You also need to install language table for ibus (Chinese) | You also need to install language table for ibus (Chinese) | ||
{{console|body= | |||
# ##i##emerge -av ibus-table-chinese | # ##i##emerge -av ibus-table-chinese | ||
}} | |||
[[Category:Install|Localization]] | [[Category:Install|Localization]] |
Revision as of 21:04, April 8, 2015
Set Default Language
On Funtoo, there are two configuration files responsible for your language settings: /etc/locale.gen
and /etc/env.d/00basic
. First file has only en_US.UTF-8 locale enabled. Last one is a default shipped file comes from stage3 and responsible for en_US.UTF-8 locale system-wide. Not recommended to edit.
The following steps will guide you through the process of setting up the default system language, using French Canadian as an example.
First you will need to edit /etc/locale.gen
:
root # nano -w /etc/locale.gen
Specify your preferred locale with the accompanying character format (you will mostly want UTF-8):
It is recommended to keep the preconfigured en_US.UTF-8 locale as a fallback.
/etc/locale.gen
en_US.UTF-8 UTF-8
fr_CA.UTF-8 UTF-8
To determine an appropriate locale for your system, you should take a look into /usr/share/i18n/SUPPORTED
for the default list of supported combinations or check the /usr/share/i18n/locales/
directory for a list of valid values.
You are strongly advised to use at least one UTF-8 locale since some applications may require it.
Now, those locales need to be generated:
root # locale-gen * Generating 2 locales (this might take a while) with 1 jobs * (1/2) Generating en_US.UTF-8 ... [ ok ] * (2/2) Generating fr_CA.UTF-8 ... [ ok ] * Generation complete
Once done, you can apply your locale settings system-wide. First display all available options:
user $ eselect locale list root ##b##Available targets for the LANG variable: [1] C [2] POSIX [3] fr_CA.utf8 [4] en_US.utf8 * [ ] (free form)
The blue star indicates the current default system locale. You can now change it according your wishes:
root # eselect locale set 3 Setting LANG to fr_CA.utf8 ... Run ". /etc/profile" to update the variable in your shell.
Alternatively, you can set the default locale manually. This file should be created first with your prefered editor:
/etc/env.d/02locale
LANG="fr_CA.utf8"
You can verify your actions using:
user $ eselect locale show root ##b##LANG variable in profile: fr_CA.utf8
For an immediate effect it is required to reload the environment:
root # env-update && source /etc/profile >>> Regenerating /etc/ld.so.cache...
Congratulations! You have successfully set up your default language on Funtoo.
Portage Settings
Portage uses a special variable LINGUAS
that defines what localizations/translations get installed by default. By default, LINGUAS
in unset, which will result in all available localizations being installed by Portage.
It is possible to customize the setting of LINGUAS
by setting it in /etc/make.conf
:
root # LINGUAS="en_US zh_CN"
The LINGUAS
variable should use spaces between each localization name.
After setting the LINGUAS USE flag you may need to re-emerge some packages:
root # emerge --ask --newuse --deep --with-bdeps=y @world
Read Your Language
A newly installed Funtoo Linux does not able to read all the languages. You want to read the stuff, say, in Mozilla Firefox. You need to install fonts - A good sign that you have not installed the proper fonts is that the following characters appear as boxes with numbers inside: 日本語フォント
Check if you have your language installed (Chinese) by using the fc-list
command from the media-libs/fontconfig
ebuild:
root # fc-list :lang=zh
If you are lucky, the right font will be installed, and your apps will also be able to use Chinese as the default language. But in case you not have the right font installed in this way, you need to install them manually.
For Japanese:
root # emerge media-fonts/kochi-substitute
For Chinese:
root # emerge media-fonts/arphicfonts
For Korean:
root # emerge media-fonts/baekmuk-fonts
Keymap
Funtoo Linux defaults to a US English keyboard. If you are using another type of keyboard, edit /etc/conf.d/keymaps
and set keymap to your keyboard model. For example, cf for French Canadian keyboard, fr for French Azerty.
root # nano -w /etc/conf.d/keymaps
Input Method
ibus is an Intelligent Input Bus for Linux.
root # emerge -av ibus
You also need to install language table for ibus (Chinese)
root # emerge -av ibus-table-chinese