/[gentoo]/xml/htdocs/doc/en/guide-localization.xml
Gentoo

Diff of /xml/htdocs/doc/en/guide-localization.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.38 Revision 1.39
1<?xml version='1.0' encoding='UTF-8'?> 1<?xml version='1.0' encoding='UTF-8'?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.38 2006/05/15 12:32:31 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.39 2006/05/25 16:22:37 neysx Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/doc/en/guide-localization.xml"> 5<guide link="/doc/en/guide-localization.xml">
6<title>Gentoo Linux Localization Guide</title> 6<title>Gentoo Linux Localization Guide</title>
7<author title="Author"> 7<author title="Author">
8 Alexander Holler 8 Alexander Holler
9</author> 9</author>
10<author title="Translator/Editor"> 10<author title="Translator/Editor">
11 <mail link="slucy@uchicago.edu">Steven Lucy</mail> 11 <mail link="slucy@uchicago.edu">Steven Lucy</mail>
12</author> 12</author>
13<author title="Editor"> 13<author title="Editor">
14 <mail link="bennyc@gentoo.org">Benny Chuang</mail> 14 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
15</author> 15</author>
16<author title="Editor"> 16<author title="Editor">
17 <mail link="pylon@gentoo.org">Lars Weiler</mail> 17 <mail link="pylon@gentoo.org">Lars Weiler</mail>
18</author> 18</author>
19<author title="Editor"> 19<author title="Editor">
20 <mail link="dertobi123@gentoo.org">Tobias Scherbaum</mail> 20 <mail link="dertobi123@gentoo.org">Tobias Scherbaum</mail>
21</author> 21</author>
22<author title="Editor"> 22<author title="Editor">
23 <mail link="flammie@gentoo.org">Flammie Pirinen</mail> 23 <mail link="flammie@gentoo.org">Flammie Pirinen</mail>
24</author> 24</author>
25 25
26<abstract> 26<abstract>
27This guide should help users localize their Gentoo Linux distribution to any 27This guide should help users localize their Gentoo Linux distribution to any
28European locale. It uses Germany as a case-study, since it is translated from 28European locale. It uses Germany as a case-study, since it is translated from
29the German doc. Includes configuration for use of the euro currency symbol. 29the German doc. Includes configuration for use of the euro currency symbol.
30</abstract> 30</abstract>
31 31
32<version>1.28</version> 32<version>1.29</version>
33<date>2006-05-15</date> 33<date>2006-05-25</date>
34 34
35<chapter> 35<chapter>
36<title>Time zone</title> 36<title>Time zone</title>
37<section> 37<section>
38<body> 38<body>
39 39
40<p> 40<p>
41In order to keep time properly, <path>/etc/localtime</path> must contain the 41In order to keep time properly, <path>/etc/localtime</path> must contain the
42correct time zone data. Look around in <path>/usr/share/zoneinfo/</path> 42correct time zone data. Look around in <path>/usr/share/zoneinfo/</path>
43and pick your timezone or a near-by big city. Please avoid the 43and pick your timezone or a near-by big city. Please avoid the
44<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not 44<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
45indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8. 45indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
46</p> 46</p>
47 47
48<pre caption="setting the timezone"> 48<pre caption="Setting the timezone">
49# <i>cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i> 49# <i>cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i>
50# <i>date</i> 50# <i>date</i>
51Sun Feb 16 08:26:44 CET 2003 51Sun Feb 16 08:26:44 CET 2003
52</pre> 52</pre>
53 53
54<note> 54<note>
55Make sure that the three-letter timezone indicator (in this case "CET") 55Make sure that the three-letter timezone indicator (in this case "CET")
56is correct for your area. 56is correct for your area.
57</note> 57</note>
58 58
59<note> 59<note>
60You can set the value of <c>TZ</c> to be everything after the 60You can set the value of <c>TZ</c> to be everything after the
61<path>/usr/share/zoneinfo</path> in your shell rc file 61<path>/usr/share/zoneinfo</path> in your shell rc file
62(<path>.bash_profile</path> for bash) for a user-level setting. In this case 62(<path>.bash_profile</path> for bash) for a user-level setting. In this case
63<c>TZ="Europe/Berlin"</c>. 63<c>TZ="Europe/Berlin"</c>.
186 </ti> 186 </ti>
187</tr> 187</tr>
188</table> 188</table>
189 189
190<note> 190<note>
191Even though most programs work with LC_ALL only, some of them misbehave if 191Even though most programs work with LC_ALL only, some of them misbehave if
192LC_ALL is set but LANG isn't. If you want to play safe, set them <e>both</e>. 192LC_ALL is set but LANG isn't. If you want to play safe, set them <e>both</e>.
193</note> 193</note>
194 194
195<p> 195<p>
196Most typically users only set the LANG variable and perhaps LC_CTYPE variable 196Most typically users only set the LANG variable and perhaps LC_CTYPE variable
197on user level by adding definitions to shells startup files defining 197on user level by adding definitions to shells startup files defining
198the environment variable manually from command line: 198the environment variable manually from command line:
199</p> 199</p>
200 200
201<pre caption="setting the German locale"> 201<pre caption="Setting the user locale in ~/.bashrc">
202export LANG="de_DE@euro" 202export LANG="de_DE@euro"
203</pre> 203</pre>
204 204
205<note> 205<note>
206Append <c>@euro</c> to your locale if you want to use the Euro 206Append <c>@euro</c> to your locale if you want to use the Euro
207currency symbol (&#8364;) 207currency symbol ()
208</note> 208</note>
209
210<p>
211It is also possible to set a system-wide locale for all users and programs:
212</p>
213
214<pre caption="Setting the default system locale in /etc/env.d/02locale">
215LC_ALL="de_DE@euro"
216LANG="de_DE@euro"
217</pre>
218
219<p>
220A common practice is to use only per user locale settings and leave the
221default system locale unset. In this case system locale defaults to a
222special value <c>"C"</c>, which for historical reasons maps to the English
223locale.
224</p>
209 225
210<p> 226<p>
211For message based localization to work in programs that support it, you will 227For message based localization to work in programs that support it, you will
212probably need to have programs compiled with the <c>nls</c> (Native language 228probably need to have programs compiled with the <c>nls</c> (Native language
213support) USE flag set. Most of the programs using nls also need the gettext 229support) USE flag set. Most of the programs using nls also need the gettext
214library to extract and use localized messages. Of course, Gentoo's Portage will 230library to extract and use localized messages. Of course, Portage will
215automatically install it when needed. 231automatically install it when needed.
216</p> 232</p>
217 233
218<p> 234<p>
219Once you have set the right locale, be sure to update your environment 235Once you have set the right locale, be sure to update your environment
220variables to make your system aware of the change: 236variables to make your system aware of the change:
221</p> 237</p>
222 238
223<pre caption="Update the environment"> 239<pre caption="Update the environment">
240<comment>(For system-wide default locale:)</comment>
224# <i>env-update &amp;&amp; source /etc/profile</i> 241# <i>env-update &amp;&amp; source /etc/profile</i>
242
243<comment>(For user-specific locale:</comment>
244$ <i>source ~/.bashrc</i>
225</pre> 245</pre>
226 246
227<p> 247<p>
228After this, you will need to kill your X server by pressing 248After this, you will need to kill your X server by pressing
229<c>Ctrl-Alt-Backspace</c>, log out, then log in as user. 249<c>Ctrl-Alt-Backspace</c>, log out, then log in as user.
230</p> 250</p>
231 251
232<p> 252<p>
233Now, verify that the changes have taken effect: 253Now, verify that the changes have taken effect:
234</p> 254</p>
235 255
236<pre caption="Verify env changes"> 256<pre caption="Verify env changes">
237$ <i>env | grep -i LC_</i> 257$ <i>env | grep -i LC_</i>
238</pre> 258</pre>
239 259
240<p> 260<p>
241There is also additional localisation variable called LINGUAS, which affects 261There is also additional localisation variable called LINGUAS, which affects
242to localisation files that get installed in gettext-based programs, and decides 262to localisation files that get installed in gettext-based programs, and decides
243used localisation for some specific software packages, such as 263used localisation for some specific software packages, such as
244<c>kde-base/kde-i18n</c> and <c>app-office/openoffice</c>. The variable 264<c>kde-base/kde-i18n</c> and <c>app-office/openoffice</c>. The variable
245takes in <e>space</e>-separated list of language codes, and suggested 265takes in <e>space</e>-separated list of language codes, and suggested
246place to set it is <path>/etc/make.conf</path>: 266place to set it is <path>/etc/make.conf</path>:
247</p> 267</p>
248 268
249<pre caption="setting LINGUAS in make.conf"> 269<pre caption="Setting LINGUAS in make.conf">
250# <i>nano -w /etc/make.conf</i> 270# <i>nano -w /etc/make.conf</i>
251<comment>(Add in the LINGUAS variable. For instance, 271<comment>(Add in the LINGUAS variable. For instance,
252for German, Finnish and English:)</comment> 272for German, Finnish and English:)</comment>
253LINGUAS="de fi en" 273LINGUAS="de fi en"
254</pre> 274</pre>
255 275
256 276
257</body> 277</body>
258</section> 278</section>
259<section> 279<section>
260<title>Generating Specific Locales</title> 280<title>Generating Specific Locales</title>
261<body> 281<body>
262 282
263<p> 283<p>
264If you use a locale that isn't available by default, you should use 284If you use a locale that isn't available by default, you should use
332<title>Keyboard layout for the console</title> 352<title>Keyboard layout for the console</title>
333<section> 353<section>
334<body> 354<body>
335 355
336<p> 356<p>
337The keyboard layout used by the console is set in 357The keyboard layout used by the console is set in
338<path>/etc/conf.d/keymaps</path> by the <c>KEYMAP</c> variable. 358<path>/etc/conf.d/keymaps</path> by the <c>KEYMAP</c> variable.
339Valid values can be found in 359Valid values can be found in
340<path>/usr/share/keymaps/<c>{arch}</c>/</path>. 360<path>/usr/share/keymaps/<c>{arch}</c>/</path>.
341<path>i386</path> has further subdivisions into layout 361<path>i386</path> has further subdivisions into layout
342(<path>qwerty/</path>, <path>azerty/</path>, etc.). Some 362(<path>qwerty/</path>, <path>azerty/</path>, etc.). Some
343languages have multiple options, so you may wish to experiment 363languages have multiple options, so you may wish to experiment
344to decide which one fits your needs best. 364to decide which one fits your needs best.
345</p> 365</p>
346 366
347<pre caption="setting the console keymap"> 367<pre caption="Setting the console keymap">
348KEYMAP="de" 368KEYMAP="de"
349KEYMAP="de-latin1" 369KEYMAP="de-latin1"
350KEYMAP="de-latin1-nodeadkeys" 370KEYMAP="de-latin1-nodeadkeys"
351</pre> 371</pre>
352 372
353</body> 373</body>
354</section> 374</section>
355</chapter> 375</chapter>
356 376
357<chapter> 377<chapter>
358<title>Keyboard layout for the X server</title> 378<title>Keyboard layout for the X server</title>
359<section> 379<section>
360<body> 380<body>
361 381
362<p> 382<p>
363The keyboard layout to be used by the X server is specified 383The keyboard layout to be used by the X server is specified
364in <path>/etc/X11/xorg.conf</path> by the <c>XkbLayout</c> 384in <path>/etc/X11/xorg.conf</path> by the <c>XkbLayout</c>
365option. 385option.
366</p> 386</p>
367 387
368<pre caption="setting the X keymap"> 388<pre caption="Setting the X keymap">
369 Section "InputDevice" 389 Section "InputDevice"
370 Identifier "Keyboard1" 390 Identifier "Keyboard1"
371 ... 391 ...
372 Option "XkbLayout" "de" 392 Option "XkbLayout" "de"
373 #Option "XkbModel" "pc105" <comment>## this is for international keyboards.</comment> 393 #Option "XkbModel" "pc105" <comment>## this is for international keyboards.</comment>
374 # Option "XkbVariant" "nodeadkeys" <comment>## this would be used for xterm input</comment> 394 # Option "XkbVariant" "nodeadkeys" <comment>## this would be used for xterm input</comment>
375 ... 395 ...
376</pre> 396</pre>
377 397
378<p> 398<p>
379If you have an international keyboard layout, you should set the option 399If you have an international keyboard layout, you should set the option
380<c>XkbModel</c> to <c>pc102</c> or <c>pc105</c>, as this will allow mapping of the 400<c>XkbModel</c> to <c>pc102</c> or <c>pc105</c>, as this will allow mapping of the
381additional keys specific to your keyboard. 401additional keys specific to your keyboard.
382</p> 402</p>
383 403
429</chapter> 449</chapter>
430 450
431<chapter> 451<chapter>
432<title>The Euro Symbol for the Console</title> 452<title>The Euro Symbol for the Console</title>
433<section> 453<section>
434<body> 454<body>
435 455
436<p> 456<p>
437In order to get your console to display the Euro symbol, you 457In order to get your console to display the Euro symbol, you
438will need to set <c>CONSOLEFONT</c> in 458will need to set <c>CONSOLEFONT</c> in
439<path>/etc/conf.d/consolefont</path> to a file found in 459<path>/etc/conf.d/consolefont</path> to a file found in
440<path>/usr/share/consolefonts/</path> (without the 460<path>/usr/share/consolefonts/</path> (without the
441<c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol. 461<c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol.
442</p> 462</p>
443 463
444<pre caption="setting the console font"> 464<pre caption="Setting the console font">
445CONSOLEFONT="lat9w-16" 465CONSOLEFONT="lat9w-16"
446</pre> 466</pre>
447 467
448<p> 468<p>
449You should verify that <c>CONSOLEFONT</c> is in the boot runlevel: 469You should verify that <c>CONSOLEFONT</c> is in the boot runlevel:
450</p> 470</p>
451 471
452<pre caption="Verify the proper runlevel"> 472<pre caption="Verify the proper runlevel">
453# <i>rc-update show | grep -i consolefont</i> 473# <i>rc-update show | grep -i consolefont</i>
454</pre> 474</pre>
455 475
456<p> 476<p>
457If no runlevel is displayed for <c>CONSOLEFONT</c>, then add it to the proper level: 477If no runlevel is displayed for <c>CONSOLEFONT</c>, then add it to the proper level:
458</p> 478</p>
459 479
467 487
468<chapter> 488<chapter>
469<title>The Euro Symbol in X</title> 489<title>The Euro Symbol in X</title>
470<section> 490<section>
471<title>Most Applications</title> 491<title>Most Applications</title>
472<body> 492<body>
473 493
474<p> 494<p>
475Getting the Euro symbol to work properly in X is a little 495Getting the Euro symbol to work properly in X is a little
476bit tougher. The first thing you should do is change the <c>fixed</c> 496bit tougher. The first thing you should do is change the <c>fixed</c>
477and <c>variable</c> definitions in 497and <c>variable</c> definitions in
478<path>/usr/X11R6/lib/X11/fonts/misc/fonts.alias</path> to end 498<path>/usr/X11R6/lib/X11/fonts/misc/fonts.alias</path> to end
479in <c>iso8859-15</c> instead of <c>iso8859-1</c>. 499in <c>iso8859-15</c> instead of <c>iso8859-1</c>.
480</p> 500</p>
481 501
482<pre caption="setting default X fonts"> 502<pre caption="Setting default X fonts">
483fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15 503fixed -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
484variable -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-15 504variable -*-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-15
485</pre> 505</pre>
486 506
487<p> 507<p>
488Some applications use their own font, and you will have to 508Some applications use their own font, and you will have to
489tell them separately to use a font with the Euro symbol. You 509tell them separately to use a font with the Euro symbol. You
490can do this at a user-specific level in 510can do this at a user-specific level in
491<path>.Xdefaults</path> (you can copy this file to 511<path>.Xdefaults</path> (you can copy this file to
492<path>/etc/skel/</path> for use by new users), or at a global 512<path>/etc/skel/</path> for use by new users), or at a global
493level for any application with a resource file in 513level for any application with a resource file in
494<path>/usr/X11R6/lib/X11/app-defaults/</path> (like xterm). In 514<path>/usr/X11R6/lib/X11/app-defaults/</path> (like xterm). In
495these files you generally have to change an existing line, 515these files you generally have to change an existing line,
496rather than adding a new one. To change our xterm font, for 516rather than adding a new one. To change our xterm font, for
497instance: 517instance:
498</p> 518</p>
499 519
500<pre caption="setting fonts for xterm"> 520<pre caption="Setting fonts for xterm">
501<comment>(in your home directory)</comment> 521<comment>(in your home directory)</comment>
502$ <i>echo 'XTerm*font: fixed' >> .Xresources </i> 522$ <i>echo 'XTerm*font: fixed' >> .Xresources </i>
503$ <i>xrdb -merge .Xresources</i> 523$ <i>xrdb -merge .Xresources</i>
504</pre> 524</pre>
505 525
506</body> 526</body>
507</section> 527</section>
508<section> 528<section>
509<title>The Euro symbol in (X)Emacs</title> 529<title>The Euro symbol in (X)Emacs</title>
510<body> 530<body>
511 531
512<p> 532<p>
513To use the Euro symbol in (X)Emacs, add the following to 533To use the Euro symbol in (X)Emacs, add the following to
514<path>.Xdefaults</path>: 534<path>.Xdefaults</path>:
515</p> 535</p>
516 536
517<pre caption="setting the font for emacs"> 537<pre caption="setting the font for emacs">
518Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-15 538Emacs.default.attributeFont: -*-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-15
519</pre> 539</pre>
520 540
521<p> 541<p>
522For XEmacs (not plain Emacs), you have to do a little 542For XEmacs (not plain Emacs), you have to do a little
523more. In <path>/home/user/.xemacs/init.el</path>, add: 543more. In <path>/home/user/.xemacs/init.el</path>, add:
524</p> 544</p>
525 545
526<pre caption="setting the font for xemacs"> 546<pre caption="setting the font for xemacs">
527(define-key global-map '(EuroSign) '[&#8364;]) 547(define-key global-map '(EuroSign) '[])
528</pre> 548</pre>
529 549
530<note> 550<note>
531The symbol in the []s is the Euro symbol. 551The symbol in the []s is the Euro symbol.
532</note> 552</note>
533 553
534</body> 554</body>
535</section> 555</section>
536<section> 556<section>
537<title>OpenOffice.Org</title> 557<title>OpenOffice.Org</title>
538<body> 558<body>
539 559
540<p> 560<p>
541The current stable <c>app-office/openoffice</c> and 561The current stable <c>app-office/openoffice</c> and
542<c>app-office/openoffice-bin</c> ebuilds support the <uri 562<c>app-office/openoffice-bin</c> ebuilds support the <uri

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20