Funtoo Linux 本地化

From Funtoo
Revision as of 10:56, April 8, 2021 by Mmwweettyy (talk | contribs) (Created page with "如果你幸运的话,正确的字体就会被安装,你的应用程序也可以使用中文作为默认语言。但如果你没有通过这种方式安装正确的字体...")
Jump to navigation Jump to search
Other languages:
English • ‎Türkçe • ‎español • ‎polski • ‎português do Brasil • ‎中文(中国大陆)‎


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.

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.


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:


You can verify your actions using:

user $ eselect locale show
root ##b##LANG variable in profile:


root # env-update && source /etc/profile
>>> Regenerating /etc/

恭喜!你已经成功地在 Funtoo 上设置了默认语言。

Portage 设置

Portage 使用一个特殊的变量 L10N 来定义默认安装的本地化/翻译。默认情况下,L10N 是未设置的,它只构建软件包的默认语言。

可以通过在 /etc/portage/make.conf 中进行设置,自定义 L10N 的设置:

   /etc/portage/make.conf (bash source code)
# Install English (United States) and Chinese (China) translations (if available)
L10N="en-US zh-CN"

The LI10N variable should use spaces between each localization name. A list of all supported languages can be found in /usr/portage/profiles/desc/l10n.desc.

Some old packages still use the deprecated LINGUAS variable. You can set it in /etc/portage/make.conf:

   /etc/portage/make.conf (bash source code)

It uses the same syntax, but uses other language codes which can be found in /usr/portage/profiles/desc/linguas.desc.

After setting the L10N and LINGUAS USE flags you may need to re-emerge some packages:

root # emerge --ask --newuse --deep --with-bdeps=y @world


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



root # emerge media-fonts/kochi-substitute


root # emerge media-fonts/arphicfonts


root # emerge media-fonts/baekmuk-fonts

一个非常好的替代方案可能是谷歌的 Noto Fonts,号称是一个支持最广泛语言的字体:

root # emerge media-fonts/noto


Funtoo Linux 默认使用美式英语键盘。如果你使用其他类型的键盘,编辑 /etc/conf.d/keymaps 并将 keymap 设置为你的键盘型号。例如,cf 代表法式加拿大键盘,fr 代表法式 Azerty。

root # nano -w /etc/conf.d/keymaps


Ibus 是一个 Linux 的智能输入总线。

root # emerge -av ibus

还需要安装 ibus 的语言表(中文)

root # emerge -av ibus-table-chinese