Localization
This article describes the localization (abbreviated L10N) and internationalization (abbreviated I18N) of software.
Contents |
System
Locale
| External resources |
A locale defines settings such as the language, the date/time format and the paper size that are used in a certain country. You can find possible locales in /usr/share/i18n/locales. E.g. for Germany choose de-DE.UTF-8. A UTF-8 based locale is strongly recommended.
Kernel
You need to activate the following kernel options:
File Systems -->
Native Language Support -->
(utf8) Default NLS Option
<*> NLS UTF8
Generate locales
Add your locales to /etc/locale.gen (optional: delete all other locales):
de_DE.UTF-8 UTF-8
Afterwards run locale-gen to generate the locales. locale -a lists all installed locales.
Use locales
Use eselect locale or manually add your locale to /etc/env.d/02locale so the system uses the locale:
LANG="de_DE.UTF-8" LC_COLLATE="C"
To apply the changes run:
root # env-update
root # source /etc/profilelocale now shows your locale.
USE flag
Portage knows the global USE flag nls for enabling support for localization in other packages (default for almost all profiles). Also set the LINGUAS variable to support only your languages, e.g. for German:
USE="... nls ..." LINGUAS="de de_DE"
A list of locales that can be used is provided as /usr/portage/profiles/desc/linguas.desc:
user $ grep -i german /usr/portage/profiles/desc/linguas.desc
de - German locale
de_DE - German locale for Germany
de_FR - German locale for France
After setting this you want to update your system so the changes take effect:
root # emerge --ask --changed-use --deep @worldConsole font
Set the font used by the console. Valid values can be found in /usr/share/consolefonts.
Set your console font in /etc/conf.d/consolefont, e.g. for German:
CONSOLEFONT="lat9w-16"
Keyboard layout
Set the keyboard layout used by the console. Valid values can be found in /usr/share/keymaps/YOUR_ARCH.
Set your keyboard layout in /etc/conf.d/keymaps, e.g. for German:
KEYMAP="de-latin1"
Time zone
See the system time article.
Software
X.Org
See the evdev article.
KDE
See the KDE article.
Input methods
To type non-Western scripts, you may need to use an input method.