- 1 Time zone
- 2 Hardware Clock
- 3 Locale system
- 4 Keyboard layout for the console
- 5 Keyboard layout for the X server
- 6 KDE
- 7 The Euro Symbol for the Console
- 8 The Euro Symbol in X
- 9 NLS
- 10 LINGUAS
- 11 Resources
- 12 Acknowledgements
In order to keep time properly, you need to select your timezone so that your system knows where it is located.
Look for your timezone in /usr/share/zoneinfo. Please avoid the /usr/share/zoneinfo/Etc/GMT* timezones as their names do not indicate the expected zones. For instance, GMT-8 is in fact GMT+8.
Suppose you want to use Brussels' timezone:
Now specify your timezone:
If you're using systemd you should set the timezone with the
timedatectl command. First check the available timezones:
Then set your chosen timezone:
Finally check the results by issuing the
timedatectl command with no arguments:
In most Gentoo Linux installations, your hardware clock is set to UTC (or GMT, Greenwich Mean Time) and then your timezone is taken into account to determine the actual, local time. If, for some reason, you need your hardware clock not to be in UTC, you will need to edit /etc/conf.d/hwclock (or if you use Gentoo BSD: /etc/conf.d/adjkerntz) and change the value of
What are locales?
A Locale is a set of information that most programs use for determining country and language specific settings. The locales and their data are part of the system library and can be found at /usr/share/locale on most systems. A locale name is generally named
ab is your two (or three) letter language code (as specified in ISO-639) and
CD is your two letter country code (as specified in ISO-3166). Variants are often appended to locale names, e.g.
de_DE@euro. Please explore Wikipedia to read more about locales and related articles.
Environment variables for locales
The variables controlling different aspects of locale settings are given in the table below. All of them take one name of a locale in
ab_CD format given above.
|LANG||Defines all locale settings at once, while allowing further individual customization via the LC_* settings below.|
|LC_COLLATE||Define alphabetical ordering of strings. This affects e.g. output of sorted directory listing.|
|LC_CTYPE||Define the character handling properties for the system. This determines which characters are seen as part of alphabet, numeric and so on. This also determines the character set used, if applicable.|
|LC_MESSAGES||Programs' localizations for applications that use message based localization scheme (majority of Gnu programs, see next chapters for closer information which do, and how to get the programs, that don't, to work).|
|LC_MONETARY||Defines currency units and formatting of currency type numeric values.|
|LC_NUMERIC||Defines formatting of numeric values which aren't monetary. Affects things such as thousand separator and decimal separator.|
|LC_TIME||Defines formatting of dates and times.|
|LC_PAPER||Defines default paper size.|
|LC_ALL||A special variable for overriding all other settings.|
Most typically users only set the LANG variable on the global basis.
Generating Specific Locales
You will probably only use one or maybe two locales on your system. You can specify locales you will need in /etc/locale.gen.
The next step is to run
locale-gen. It will generate all the locales you have specified in the /etc/locale.gen file.
You can verify that your selected locales are available by running
Setting a locale
When using OpenRC locale settings are stored in environment variables. These are typically set in the /etc/env.d/02locale (for system-wide settings) and ~/.bashrc (for user-specific settings) file, and can be managed through
eselect locale. For instance, to set the
LANG variable to the
Of course, you can edit the file manually as well and diversify the locale variables.
It's also possible, and pretty common especially in a more traditional UNIX environment, to leave the global settings unchanged, i.e. in the "
C" locale. Users can still specify their preferred locale in their own shell RC file:
Another way of configuring system is to leave it in the default C locale, but enable UTF-8 character representation at the same time. This option is achieved using the following settings in /etc/env.d/02locale:
Using the above snippet, users will be able to see localized file names properly, while not being forced to your preferred language.
Once you have set the right locale, be sure to update your environment variables to make your system aware of the change.
For a system-wide default locale:
For a user-specific locale:
After this, you will need to kill your X server by pressing Ctrl + Alt + Backspace, log out, then log in as user.
Now, verify that the changes have taken effect:
If you use systemd you should set your locale with the
localectl command. Check the list of available locales with:
Then set the locale you want:
Finally check if the result is good:
Keyboard layout for the console
The keyboard layout used by the console is set in /etc/conf.d/keymaps by the
keymap variable. Valid values can be found in /usr/share/keymaps/YOUR_ARCH/. i386 has further subdivisions into layout (qwerty/, azerty/, etc.). Some languages have multiple options, so you may wish to experiment to decide which one fits your needs best.
With systemd the keymap layout used for your console can be set using the
localectl command. First check the available keymap layouts:
Then set the console keymap layout you want:
Finally check if the console keymap layout was set correctly:
Keyboard layout for the X server
The keyboard layout to be used by the X server is specified in /etc/X11/xorg.conf by the
If you have an international keyboard layout, you should set the option
pc105 , as this will allow mapping of the additional keys specific to your keyboard.
Deadkeys allow you to press keys that will not show immediately but will be combined with another letter to produce a single character. Setting
nodeadkeys allows input these special characters into X terminals.
If you would like to switch between more than one keyboard layout (for example English and Russian), all you have to do is add a few lines to xorg.conf that specify the desired layouts and the shortcut command.
XkbOptions allows you to toggle between keyboard layouts by simply pressing
Alt-Shift . This will also toggle the Scroll Lock light on or off, thanks to the
grp_led:scroll option. This is a handy visual indicator of which keyboard layout you are using at the moment.
With systemd the keymap layout for the X11 server can be set using the
localectl command. First check the available X11 keymap layouts:
Then set the X11 keymap layout you want:
Finally check if the X11 keymap layout was set correctly:
For KDE you have to install the
app-office/calligra-l10n packages. These respect the described earlier.
The Euro Symbol for the Console
In order to get your console to display the Euro symbol, you will need to set
consolefont in /etc/conf.d/consolefont to a file found in /usr/share/consolefonts/ (without the
lat9w-16 has the Euro symbol.
You should verify that
consolefont is in the boot runlevel:
If no runlevel is displayed for
consolefont , then add it to the proper level:
The Euro Symbol in X
Getting the Euro symbol to work properly in X is a little bit tougher. The first thing you should do is change the
variable definitions in /usr/share/fonts/misc/fonts.alias to end in
iso8859-15 instead of
Some applications use their own font, and you will have to tell them separately to use a font with the Euro symbol. You can do this at a user-specific level in .Xdefaults (you can copy this file to /etc/skel/ for use by new users), or at a global level for any application with a resource file in /usr/share/X11/app-defaults/ (like xterm). In these files you generally have to change an existing line, rather than adding a new one. To change our xterm font, for instance:
The Euro symbol in (X)Emacs
To use the Euro symbol in (X)Emacs, add the following to .Xdefaults :
For XEmacs (not plain Emacs), you have to do a little more. In /home/user/.xemacs/init.el , add:
The current stable
app-office/libreoffice-bin ebuilds support the for selecting installed GUI language packs. To see the status of GUI translation, hyphenation, spell checking and other localisations on your language, please refer to LibreOffice translation web site .
For message based localization to work in programs that support it, you will probably need to have programs compiled with the
nls (Native language support) USE flag set. Most of the programs using nls also need the gettext library to extract and use localized messages. Of course, Portage will automatically install it when needed.
After enabling the
nls USE flag you may need to re-emerge some packages:
There is also additional localization variable called
LINGUAS, which affects to localization files that get installed in gettext-based programs, and decides used localization for some specific software packages, such as
app-office/libreoffice. The variable takes in space-separated list of language codes, and suggested place to set it is /etc/portage/make.conf:
A list of locales that can be used is provided as /usr/portage/profiles/desc/linguas.desc :
After setting the
LINGUAS USE flag you may need to re-emerge some packages:
We would like to thank the following authors and editors for their contributions to this guide:
- Alexander Holler
- Steven Lucy
- Benny Chuang
- Lars Weiler
- Tobias Scherbaum
- Flammie Pirinen