Gentoo Logo
Gentoo Logo Side

Gentoo Linux Localization Guide

Contents:

1.Timezone

In order to keep time properly, /etc/localtime must point to the correct time zone data file. Look around in /usr/share/zoneinfo/ and pick your timezone or a near-by big city.

Code listing 1.1: setting the timezone

# ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
# date
Sun Feb 16 08:26:44 CET 2003

Note: Make sure that the three-letter timezone indicator (in this case "CET") is correct for your area.

Note: You can set the value of TZ to be everything after the /usr/share/zoninfo in your shell rc file (.bash_profile for bash) for a user-level setting. In this case TZ="Europe/Berlin".

2.System Clock

In most Gentoo Linux installations, your system clock is set to UTC (or GMT, Greenwhich Mean Time) and then your timezone is taken into account to determine the actual, local time. If, for some reason, you need your system clock not to be in UTC, you will need to edit /etc/rc.conf and change the value of CLOCK.

Code listing 2.1: local vs. GMT clock

 // recommended:
 CLOCK="UTC"
 // or:
 CLOCK="local"

3.POSIX Locale

The next step is to set the LANG shell variable, which is used by your shell and window manager (and some other applications). Valid values can be found in /usr/share/locale and generally take the form ab_CD, where ab is your two letter language code and CD is your two letter country code. the _CD is left off if your language is only (or primarily) spoken in one country. LANG can be set in /etc/profile if you want it to take effect system-wide, or in ~/.bashrc as a user-specific setting.

Code listing 3.1: setting the POSIX locale

 export LANG="de_DE@euro"

Note: Appended @euro to your locale if you want to use the new Euro currency symbol (¤)

4.Keyboard layout for the console

The keyboard layoud used by the console is set in /etc/rc.conf 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.

Code listing 4.1: setting the console keymap

 KEYMAP="de"
 KEYMAP="de-latin1"
 KEYMAP="de-latin1-nodeadkeys"

5.Keyboard layout for the X server

The keyboard layout to be used by the X server is specified in /etc/X11/XF86Config by the XkbLayout option.

Code listing 5.1: setting the X keymap

 Section "InputDevice"
     Identifier  "Keyboard1"
     ...
     Option "XkbLayout"    "de"
     # Option XkbVariant"  "nodeadkeys"
     ...

6.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/rc.conf to a file found in /usr/share/consolefonts/ (without the .psfu.gz). lat0-16 has the Euro symbol.

Code listing 6.1: setting the console font

 CONSOLEFONT="lat0-16"

7.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/X11R6/lib/X11/fonts/misc/fonts.alias to end in iso8859-15 instead of iso8859-1.

Code listing 7.1: setting default X fonts

 fixed        -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
 variable     -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-15

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/X11R6/lib/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:

Code listing 7.2: setting fonts for xterm

 // (in your home directory)
 $ echo 'XTerm*font: fixed' >> .Xresources 
 $ xrdb -merge .Xresources

The Euro symbol in (X)Emacs 

To use the Euro symbol in (X)Emacs, add the following to .Xdefaults:

Code listing 7.3: setting the font for emacs

 Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-15

For XEmacs (not plain Emacs), you have to do a little more. In /home/user/.xemacs/init.el, add:

Code listing 7.4: setting the font for xemacs

 (define-key global-map '(EuroSign) '[¤])

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



line
Updated $Date: 2003/2/15 01:33:44 $
line
Alexander Holler
Author

Steven Lucy
Translator/Editor

line
Summary:  This guide should help users localize their Gentoo Linux distribution to any European locale. It uses Germany as a case-study, since it is translated from the German doc. Includes configuration for use of the Euro currency symbol.
line

Donate to support our development efforts.

line
DDR Memory at Crucial.com

Purchase RAM from Crucial.com and a percentage of your sale will go towards further Gentoo Linux development.

line

Looking for the right Web designer? Marketingtool.com is the world's largest directory of Web developers and other marketing-oriented firms. Use Marketingtool.com's free "Editor's Pick" service to find the Web design team that meets your exact needs.

Are you a Web designer? Then place a featured listing on Marketingtool.com to get noticed world-wide!

When you use "Editor's Pick" or place a featured listing, Marketingtool.com will donate a portion of revenue to the Gentoo Linux free software project.

line
Copyright 2001-2002 Gentoo Technologies, Inc. Questions, Comments, Corrections? Email gentoo-dev@gentoo.org.