<?xml version='1.0' encoding='UTF-8'?>
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.12 2004/02/12 22:25:42 dertobi123 Exp $ -->
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">

<guide link="/doc/en/guide-localization.xml">
<title>Gentoo Linux Localization Guide</title>
<author title="Author">
  <mail link="holler@gentoo.de">Alexander Holler</mail>
</author>
<author title="Translator/Editor">
  <mail link="slucy@uchicago.edu">Steven Lucy</mail>
</author>
<author title="Editor">
  <mail link="bennyc@gentoo.org">Benny Chuang</mail>
</author>
<author title="Editor">
  <mail link="pylon@gentoo.org">Lars Weiler</mail>
</author>

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

<version>1.9</version>
<date>February 12, 2004</date>

<chapter>
<title>Timezone</title>
<section>
<body>

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

<pre caption="setting the timezone">
# <i>ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i>
# <i>date</i>
Sun Feb 16 08:26:44 CET 2003
</pre>

<note>
Make sure that the three-letter timezone indicator (in this case "CET")
is correct for your area.
</note>

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

</body>
</section>
</chapter>

<chapter>
<title>System Clock</title>
<section>
<body>

<p>
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 <path>/etc/rc.conf</path> and change the
value of <i>CLOCK</i>.
</p>

<pre caption="local vs. GMT clock">
<codenote>recommended:</codenote>
CLOCK="UTC"
<codenote>or:</codenote>
CLOCK="local"
</pre>

</body>
</section>
</chapter>

<chapter>
<title>POSIX Locale</title>
<section>
<body>

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

<pre caption="setting the POSIX locale">
export LANG="de_DE@euro"
</pre>

<note>
Appended <i>@euro</i> to your locale if you want to use the new Euro
currency symbol (&#8364;)
</note>

</body>
</section>
</chapter>

<chapter>
<title>Keyboard layout for the console</title>
<section>
<body>

<p>
The keyboard layout used by the console is set in
<path>/etc/rc.conf</path> by the <i>KEYMAP</i> variable.
Valid values can be found in
<path>/usr/share/keymaps/<i>{arch}</i>/</path>.
<path>i386</path> has further subdivisions into layout
(<path>qwerty/</path>, <path>azerty/</path>, etc.).  Some
languages have multiple options, so you may wish to experiment
to decide which one fits your needs best.
</p>

<pre caption="setting the console keymap">
KEYMAP="de"
KEYMAP="de-latin1"
KEYMAP="de-latin1-nodeadkeys"
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Keyboard layout for the X server</title>
<section>
<body>

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

<pre caption="setting the X keymap">
 Section "InputDevice"
     Identifier  "Keyboard1"
     ...
     Option "XkbLayout"    "de"
     # Option "XkbVariant"  "nodeadkeys"
     ...
</pre>

</body>
</section>
</chapter>

<chapter>
<title>KDE</title>
<section>
<body>

<p>
For KDE you have to install the kde-i18n package with the appropriate
LINGUAS environment variable set:</p>

<pre caption="Install localized KDE">
# <i>LINGUAS="de" emerge kde-i18n</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>The Euro Symbol for the Console</title>
<section>
<body>

<p>
In order to get your console to display the Euro symbol, you
will need to set <i>CONSOLEFONT</i> in
<path>/etc/rc.conf</path> to a file found in
<path>/usr/share/consolefonts/</path> (without the
<c>.psfu.gz</c>).  <c>lat9w-16</c> has the Euro symbol.
</p>

<pre caption="setting the console font">
CONSOLEFONT="lat9w-16"
</pre>

</body>
</section>
</chapter>

<chapter>
<title>The Euro Symbol in X</title>
<section>
<title>Most Applications</title>
<body>

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

<pre caption="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
</pre>

<p>
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
<path>.Xdefaults</path> (you can copy this file to
<path>/etc/skel/</path> for use by new users), or at a global
level for any application with a resource file in
<path>/usr/X11R6/lib/X11/app-defaults/</path> (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:
</p>

<pre caption="setting fonts for xterm">
<codenote>(in your home directory)</codenote>
# <i>echo 'XTerm*font: fixed' >> .Xresources </i>
# <i>xrdb -merge .Xresources</i>
</pre>

</body>
</section>
<section>
<title>The Euro symbol in (X)Emacs</title>
<body>

<p>
To use the Euro symbol in (X)Emacs, add the following to
<path>.Xdefaults</path>:
</p>

<pre caption="setting the font for emacs">
Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-15
</pre>

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

<pre caption="setting the font for xemacs">
(define-key global-map '(EuroSign) '[&#8364;])
</pre>

<note>
The symbol in the []s is the Euro symbol.
</note>

</body>
</section>
<section>
<title>Language for OpenOffice</title>
<body>

<note>
Customized default language is not available for openoffice-bin ebuild. The
default language in the openoffice-bin is ENUS.
</note>

<p>
The default language for OpenOffice is set as "ENUS"(01). If you wish to
change the default language for OpenOffice, check the ebuild for the
default language code. 
</p>

<pre caption="emerge openoffice with desired default language">
# <i>LANGUAGE="01" emerge openoffice</i>
<comment>01 is the ENUS language code for openoffice</comment>
</pre>

</body>
</section>
</chapter>

</guide>
