

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. You then set your timezone in /etc/timezone. 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.

# ls /usr/share/zoneinfo
(Suppose you want to use Brussels)
(First copy the proper zone to localtime)
(Now specify your timezone)
# nano -w /etc/timezone

# date
Wed Mar  8 00:46:05 CET 2006
Hardware Clock

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 clock from UTC to local.

Locale system
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_CD where 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. en_GB.UTF-8 or de_DE@euro. Please explore Wikipedia to read more about locales and related articles.

Environment variables for locales

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. 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_MONETARYDefines 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_TIMEDefines formatting of dates and times.LC_PAPERDefines default paper size.LC_ALL A special variable for overriding all other settings.
Variable name Explanation
Some programs are written in such a way that they expect traditional English ordering of the alphabet, while some locales, most notably the Estonian one, use a different ordering. Therefore it's recommended to explicitly set LC_COLLATE to C when dealing with system-wide settings. Using LC_ALL is strongly discouraged as it can't be overridden later on. Please use it only when testing and never set it in a startup file.

Most typically users only set the LANG variable on the global basis. This example is for a unicode German locale:

Use de_DE@euro as your LANG if you want to use the Euro currency symbol (€) on non UTF-8 based locales.

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:

export LANG="de_DE.UTF-8"
export LC_COLLATE="C"

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.



(For system-wide default locale:)
# env-update && source /etc/profile

(For user-specific locale:)
$ source ~/.bashrc


Now, verify that the changes have taken effect:

$ locale

There is also additional localisation variable called LINGUAS, which affects to localisation files that get installed in gettext-based programs, and decides used localisation for some specific software packages, such as kde-base/kde-l10n and app-office/openoffice. The variable takes in space-separated list of language codes, and suggested place to set it is /etc/make.conf:

# nano -w /etc/make.conf
(Add in the LINGUAS variable. For instance, 
for German, Finnish and English:)
LINGUAS="de fi en"
Generating Specific Locales


en_GB ISO-8859-1
en_GB.UTF-8 UTF-8
de_DE ISO-8859-1
de_DE@euro ISO-8859-15


locale-gen is available in glibc-2.3.6-r4 and newer. If you have an older version of glibc, you should update it now.


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/{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.

Keyboard layout for the X server


Section "InputClass"
	Identifier "keyboard-all"
	Driver "evdev"
	Option "XkbLayout" "de"
	#Option "XkbModel" "pc105"
	MatchIsKeyboard "on"




Section "InputClass"
	Identifier "keyboard-all"
	Driver "evdev"
	Option "XkbLayout"    "us,ru"
	Option "XkbOptions"   "grp:alt_shift_toggle,grp_led:scroll"
	MatchIsKeyboard "on"



For KDE you have to install the kde-base/kde-l10n and app-office/calligra-l10n packages. These respect the LINGUAS variable 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 .psfu.gz). lat9w-16 has the Euro symbol.


You should verify that consolefont is in the boot runlevel:

# rc-update -v show | grep consolefont

If no runlevel is displayed for consolefont, then add it to the proper level:

# rc-update add consolefont boot
The Euro Symbol in X
Most Applications

Getting the Euro symbol to work properly in X is a little bit tougher. The first thing you should do is change the fixed and variable definitions in /usr/share/fonts/misc/fonts.alias to end in iso8859-15 instead of iso8859-1.



(in your home directory)
$ xrdb -merge .Xresources
The Euro symbol in (X)Emacs




The symbol in the []s is the Euro symbol.
