| 1 |
<?xml version='1.0' encoding='UTF-8'?>
|
| 2 |
<!-- $Header: /home/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.13 2004/04/11 10:52:16 cam Exp $ -->
|
| 3 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
|
| 4 |
|
| 5 |
<guide link="/doc/en/guide-localization.xml">
|
| 6 |
<title>Gentoo Linux Localization Guide</title>
|
| 7 |
<author title="Author">
|
| 8 |
<mail link="holler@gentoo.de">Alexander Holler</mail>
|
| 9 |
</author>
|
| 10 |
<author title="Translator/Editor">
|
| 11 |
<mail link="slucy@uchicago.edu">Steven Lucy</mail>
|
| 12 |
</author>
|
| 13 |
<author title="Editor">
|
| 14 |
<mail link="bennyc@gentoo.org">Benny Chuang</mail>
|
| 15 |
</author>
|
| 16 |
<author title="Editor">
|
| 17 |
<mail link="pylon@gentoo.org">Lars Weiler</mail>
|
| 18 |
</author>
|
| 19 |
|
| 20 |
<abstract>
|
| 21 |
This guide should help users localize their Gentoo Linux distribution to any
|
| 22 |
European locale. It uses Germany as a case-study, since it is translated from
|
| 23 |
the German doc. Includes configuration for use of the Euro currency symbol.
|
| 24 |
</abstract>
|
| 25 |
|
| 26 |
<version>1.10</version>
|
| 27 |
<date>April 11, 2004</date>
|
| 28 |
|
| 29 |
<chapter>
|
| 30 |
<title>Timezone</title>
|
| 31 |
<section>
|
| 32 |
<body>
|
| 33 |
|
| 34 |
<p>
|
| 35 |
In order to keep time properly, <path>/etc/localtime</path> must point to
|
| 36 |
the correct time zone data file. Look around in
|
| 37 |
<path>/usr/share/zoneinfo/</path> and pick your timezone or a near-by big city.
|
| 38 |
</p>
|
| 39 |
|
| 40 |
<pre caption="setting the timezone">
|
| 41 |
# <i>ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i>
|
| 42 |
# <i>date</i>
|
| 43 |
Sun Feb 16 08:26:44 CET 2003
|
| 44 |
</pre>
|
| 45 |
|
| 46 |
<note>
|
| 47 |
Make sure that the three-letter timezone indicator (in this case "CET")
|
| 48 |
is correct for your area.
|
| 49 |
</note>
|
| 50 |
|
| 51 |
<note>
|
| 52 |
You can set the value of <c>TZ</c> to be everything after the
|
| 53 |
<path>/usr/share/zoneinfo</path> in your shell rc file
|
| 54 |
(<path>.bash_profile</path> for bash) for a user-level setting. In this case
|
| 55 |
<c>TZ="Europe/Berlin"</c>.
|
| 56 |
</note>
|
| 57 |
|
| 58 |
</body>
|
| 59 |
</section>
|
| 60 |
</chapter>
|
| 61 |
|
| 62 |
<chapter>
|
| 63 |
<title>System Clock</title>
|
| 64 |
<section>
|
| 65 |
<body>
|
| 66 |
|
| 67 |
<p>
|
| 68 |
In most Gentoo Linux installations, your system clock is set to
|
| 69 |
UTC (or GMT, Greenwhich Mean Time) and then your timezone is
|
| 70 |
taken into account to determine the actual, local time. If,
|
| 71 |
for some reason, you need your system clock not to be in UTC,
|
| 72 |
you will need to edit <path>/etc/rc.conf</path> and change the
|
| 73 |
value of <c>CLOCK</c>.
|
| 74 |
</p>
|
| 75 |
|
| 76 |
<pre caption="local vs. GMT clock">
|
| 77 |
<codenote>recommended:</codenote>
|
| 78 |
CLOCK="UTC"
|
| 79 |
<codenote>or:</codenote>
|
| 80 |
CLOCK="local"
|
| 81 |
</pre>
|
| 82 |
|
| 83 |
</body>
|
| 84 |
</section>
|
| 85 |
</chapter>
|
| 86 |
|
| 87 |
<chapter>
|
| 88 |
<title>POSIX Locale</title>
|
| 89 |
<section>
|
| 90 |
<title>Using Existing Locales</title>
|
| 91 |
<body>
|
| 92 |
|
| 93 |
<p>
|
| 94 |
The next step is to set the <c>LANG</c> shell variable, which
|
| 95 |
is used by your shell and window manager (and some other
|
| 96 |
applications). Valid values can be found in
|
| 97 |
<path>/usr/share/locale</path> and generally take the form
|
| 98 |
<c>ab_CD</c>, where <c>ab</c> is your two letter language code
|
| 99 |
and <c>CD</c> is your two letter country code. The <c>_CD</c>
|
| 100 |
is left off if your language is only (or primarily) spoken in
|
| 101 |
one country. <c>LANG</c> can be set in
|
| 102 |
<path>/etc/profile</path> if you want it to take effect
|
| 103 |
system-wide, or in <path>~/.bashrc</path> as a user-specific
|
| 104 |
setting.
|
| 105 |
</p>
|
| 106 |
|
| 107 |
<pre caption="setting the POSIX locale">
|
| 108 |
export LANG="de_DE@euro"
|
| 109 |
</pre>
|
| 110 |
|
| 111 |
<note>
|
| 112 |
Appended <c>@euro</c> to your locale if you want to use the new Euro
|
| 113 |
currency symbol (€)
|
| 114 |
</note>
|
| 115 |
|
| 116 |
</body>
|
| 117 |
</section>
|
| 118 |
<section>
|
| 119 |
<title>Generating Specific Locales</title>
|
| 120 |
<body>
|
| 121 |
|
| 122 |
<p>
|
| 123 |
If you use a locale that isn't available by default, you should use
|
| 124 |
<c>localedef</c> to generate your locale. For instance:
|
| 125 |
</p>
|
| 126 |
|
| 127 |
<pre caption="Generating a locale using localedef">
|
| 128 |
# <i>localedef -c -i en_US -f ISO-8859-15 en_US.ISO-8859-15</i>
|
| 129 |
</pre>
|
| 130 |
|
| 131 |
<p>
|
| 132 |
After having generated the locale, you can export the LANG variable as you see
|
| 133 |
fit.
|
| 134 |
</p>
|
| 135 |
|
| 136 |
<pre caption="Exporting the LANG variable">
|
| 137 |
# <i>export LANG="en_US.ISO-8859-15"</i>
|
| 138 |
</pre>
|
| 139 |
|
| 140 |
</body>
|
| 141 |
</section>
|
| 142 |
</chapter>
|
| 143 |
|
| 144 |
<chapter>
|
| 145 |
<title>Keyboard layout for the console</title>
|
| 146 |
<section>
|
| 147 |
<body>
|
| 148 |
|
| 149 |
<p>
|
| 150 |
The keyboard layout used by the console is set in
|
| 151 |
<path>/etc/rc.conf</path> by the <c>KEYMAP</c> variable.
|
| 152 |
Valid values can be found in
|
| 153 |
<path>/usr/share/keymaps/<c>{arch}</c>/</path>.
|
| 154 |
<path>i386</path> has further subdivisions into layout
|
| 155 |
(<path>qwerty/</path>, <path>azerty/</path>, etc.). Some
|
| 156 |
languages have multiple options, so you may wish to experiment
|
| 157 |
to decide which one fits your needs best.
|
| 158 |
</p>
|
| 159 |
|
| 160 |
<pre caption="setting the console keymap">
|
| 161 |
KEYMAP="de"
|
| 162 |
KEYMAP="de-latin1"
|
| 163 |
KEYMAP="de-latin1-nodeadkeys"
|
| 164 |
</pre>
|
| 165 |
|
| 166 |
</body>
|
| 167 |
</section>
|
| 168 |
</chapter>
|
| 169 |
|
| 170 |
<chapter>
|
| 171 |
<title>Keyboard layout for the X server</title>
|
| 172 |
<section>
|
| 173 |
<body>
|
| 174 |
|
| 175 |
<p>
|
| 176 |
The keyboard layout to be used by the X server is specified
|
| 177 |
in <path>/etc/X11/XF86Config</path> by the <c>XkbLayout</c>
|
| 178 |
option.
|
| 179 |
</p>
|
| 180 |
|
| 181 |
<pre caption="setting the X keymap">
|
| 182 |
Section "InputDevice"
|
| 183 |
Identifier "Keyboard1"
|
| 184 |
...
|
| 185 |
Option "XkbLayout" "de"
|
| 186 |
# Option "XkbVariant" "nodeadkeys"
|
| 187 |
...
|
| 188 |
</pre>
|
| 189 |
|
| 190 |
</body>
|
| 191 |
</section>
|
| 192 |
</chapter>
|
| 193 |
|
| 194 |
<chapter>
|
| 195 |
<title>KDE</title>
|
| 196 |
<section>
|
| 197 |
<body>
|
| 198 |
|
| 199 |
<p>
|
| 200 |
For KDE you have to install the kde-i18n package with the appropriate
|
| 201 |
LINGUAS environment variable set:</p>
|
| 202 |
|
| 203 |
<pre caption="Install localized KDE">
|
| 204 |
# <i>LINGUAS="de" emerge kde-i18n</i>
|
| 205 |
</pre>
|
| 206 |
|
| 207 |
</body>
|
| 208 |
</section>
|
| 209 |
</chapter>
|
| 210 |
|
| 211 |
<chapter>
|
| 212 |
<title>The Euro Symbol for the Console</title>
|
| 213 |
<section>
|
| 214 |
<body>
|
| 215 |
|
| 216 |
<p>
|
| 217 |
In order to get your console to display the Euro symbol, you
|
| 218 |
will need to set <c>CONSOLEFONT</c> in
|
| 219 |
<path>/etc/rc.conf</path> to a file found in
|
| 220 |
<path>/usr/share/consolefonts/</path> (without the
|
| 221 |
<c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol.
|
| 222 |
</p>
|
| 223 |
|
| 224 |
<pre caption="setting the console font">
|
| 225 |
CONSOLEFONT="lat9w-16"
|
| 226 |
</pre>
|
| 227 |
|
| 228 |
</body>
|
| 229 |
</section>
|
| 230 |
</chapter>
|
| 231 |
|
| 232 |
<chapter>
|
| 233 |
<title>The Euro Symbol in X</title>
|
| 234 |
<section>
|
| 235 |
<title>Most Applications</title>
|
| 236 |
<body>
|
| 237 |
|
| 238 |
<p>
|
| 239 |
Getting the Euro symbol to work properly in X is a little
|
| 240 |
bit tougher. The first thing you should do is change the <c>fixed</c>
|
| 241 |
and <c>variable</c> definitions in
|
| 242 |
<path>/usr/X11R6/lib/X11/fonts/misc/fonts.alias</path> to end
|
| 243 |
in <c>iso8859-15</c> instead of <c>iso8859-1</c>.
|
| 244 |
</p>
|
| 245 |
|
| 246 |
<pre caption="setting default X fonts">
|
| 247 |
fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
|
| 248 |
variable -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-15
|
| 249 |
</pre>
|
| 250 |
|
| 251 |
<p>
|
| 252 |
Some applications use their own font, and you will have to
|
| 253 |
tell them separately to use a font with the Euro symbol. You
|
| 254 |
can do this at a user-specific level in
|
| 255 |
<path>.Xdefaults</path> (you can copy this file to
|
| 256 |
<path>/etc/skel/</path> for use by new users), or at a global
|
| 257 |
level for any application with a resource file in
|
| 258 |
<path>/usr/X11R6/lib/X11/app-defaults/</path> (like xterm). In
|
| 259 |
these files you generally have to change an existing line,
|
| 260 |
rather than adding a new one. To change our xterm font, for
|
| 261 |
instance:
|
| 262 |
</p>
|
| 263 |
|
| 264 |
<pre caption="setting fonts for xterm">
|
| 265 |
<codenote>(in your home directory)</codenote>
|
| 266 |
# <i>echo 'XTerm*font: fixed' >> .Xresources </i>
|
| 267 |
# <i>xrdb -merge .Xresources</i>
|
| 268 |
</pre>
|
| 269 |
|
| 270 |
</body>
|
| 271 |
</section>
|
| 272 |
<section>
|
| 273 |
<title>The Euro symbol in (X)Emacs</title>
|
| 274 |
<body>
|
| 275 |
|
| 276 |
<p>
|
| 277 |
To use the Euro symbol in (X)Emacs, add the following to
|
| 278 |
<path>.Xdefaults</path>:
|
| 279 |
</p>
|
| 280 |
|
| 281 |
<pre caption="setting the font for emacs">
|
| 282 |
Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-15
|
| 283 |
</pre>
|
| 284 |
|
| 285 |
<p>
|
| 286 |
For XEmacs (not plain Emacs), you have to do a little
|
| 287 |
more. In <path>/home/user/.xemacs/init.el</path>, add:
|
| 288 |
</p>
|
| 289 |
|
| 290 |
<pre caption="setting the font for xemacs">
|
| 291 |
(define-key global-map '(EuroSign) '[€])
|
| 292 |
</pre>
|
| 293 |
|
| 294 |
<note>
|
| 295 |
The symbol in the []s is the Euro symbol.
|
| 296 |
</note>
|
| 297 |
|
| 298 |
</body>
|
| 299 |
</section>
|
| 300 |
<section>
|
| 301 |
<title>Language for OpenOffice</title>
|
| 302 |
<body>
|
| 303 |
|
| 304 |
<note>
|
| 305 |
Customized default language is not available for openoffice-bin ebuild. The
|
| 306 |
default language in the openoffice-bin is ENUS.
|
| 307 |
</note>
|
| 308 |
|
| 309 |
<p>
|
| 310 |
The default language for OpenOffice is set as "ENUS"(01). If you wish to
|
| 311 |
change the default language for OpenOffice, check the ebuild for the
|
| 312 |
default language code.
|
| 313 |
</p>
|
| 314 |
|
| 315 |
<pre caption="emerge openoffice with desired default language">
|
| 316 |
# <i>LANGUAGE="01" emerge openoffice</i>
|
| 317 |
<comment>01 is the ENUS language code for openoffice</comment>
|
| 318 |
</pre>
|
| 319 |
|
| 320 |
</body>
|
| 321 |
</section>
|
| 322 |
</chapter>
|
| 323 |
|
| 324 |
</guide>
|