| 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.28 2005/06/24 18:04:15 fox2mike Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.37 2006/04/24 21:15:22 nightmorph 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"> |
| … | |
… | |
| 27 | This guide should help users localize their Gentoo Linux distribution to any |
27 | This guide should help users localize their Gentoo Linux distribution to any |
| 28 | European locale. It uses Germany as a case-study, since it is translated from |
28 | European locale. It uses Germany as a case-study, since it is translated from |
| 29 | the German doc. Includes configuration for use of the euro currency symbol. |
29 | the German doc. Includes configuration for use of the euro currency symbol. |
| 30 | </abstract> |
30 | </abstract> |
| 31 | |
31 | |
| 32 | <version>1.19</version> |
32 | <version>1.27</version> |
| 33 | <date>2005-06-24</date> |
33 | <date>2006-04-24</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> |
| 41 | In order to keep time properly, <path>/etc/localtime</path> must point to |
41 | In order to keep time properly, <path>/etc/localtime</path> must contain the |
| 42 | the correct time zone data file. Look around in |
42 | correct time zone data. Look around in <path>/usr/share/zoneinfo/</path> |
| 43 | <path>/usr/share/zoneinfo/</path> and pick your timezone or a near-by big city. |
43 | and 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 |
|
|
45 | indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8. |
| 44 | </p> |
46 | </p> |
| 45 | |
47 | |
| 46 | <pre caption="setting the timezone"> |
48 | <pre caption="setting the timezone"> |
| 47 | # <i>ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i> |
49 | # <i>cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime</i> |
| 48 | # <i>date</i> |
50 | # <i>date</i> |
| 49 | Sun Feb 16 08:26:44 CET 2003 |
51 | Sun Feb 16 08:26:44 CET 2003 |
| 50 | </pre> |
52 | </pre> |
| 51 | |
53 | |
| 52 | <note> |
54 | <note> |
| … | |
… | |
| 101 | country and language specific settings. The locales and their data |
103 | country and language specific settings. The locales and their data |
| 102 | are part of the system library and can be found |
104 | are part of the system library and can be found |
| 103 | at <path>/usr/share/locale</path> on most systems. A locale name is generally |
105 | at <path>/usr/share/locale</path> on most systems. A locale name is generally |
| 104 | named <c>ab_CD</c> where <c>ab</c> is your two (or three) letter |
106 | named <c>ab_CD</c> where <c>ab</c> is your two (or three) letter |
| 105 | language code (as specified in ISO-639) and <c>CD</c> is your two letter country |
107 | language code (as specified in ISO-639) and <c>CD</c> is your two letter country |
| 106 | code (as specified in ISO-3199). |
108 | code (as specified in ISO-3166). |
| 107 | </p> |
109 | </p> |
| 108 | |
110 | |
| 109 | </body> |
111 | </body> |
| 110 | </section> |
|
|
| 111 | <section> |
112 | </section> |
|
|
113 | <section id="variables"> |
| 112 | <title>Environment variables for locales</title> |
114 | <title>Environment variables for locales</title> |
| 113 | <body> |
115 | <body> |
| 114 | |
116 | |
| 115 | <p> |
117 | <p> |
| 116 | Locale settings are stored in environment variables. These are typically |
118 | Locale settings are stored in environment variables. These are typically |
| … | |
… | |
| 211 | support) USE flag set. Most of the programs using nls also need the gettext |
213 | support) USE flag set. Most of the programs using nls also need the gettext |
| 212 | library to extract and use localized messages. Of course, Gentoo's Portage will |
214 | library to extract and use localized messages. Of course, Gentoo's Portage will |
| 213 | automatically install it when needed. |
215 | automatically install it when needed. |
| 214 | </p> |
216 | </p> |
| 215 | |
217 | |
|
|
218 | <p> |
|
|
219 | Once you have set the right locale, be sure to update your environment |
|
|
220 | variables to make your system aware of the change: |
|
|
221 | </p> |
|
|
222 | |
|
|
223 | <pre caption="Update the environment"> |
|
|
224 | # <i>env-update && source /etc/profile</i> |
|
|
225 | </pre> |
|
|
226 | |
|
|
227 | <p> |
|
|
228 | After this, you will need to kill your X server by pressing |
|
|
229 | <c>Ctrl-Alt-Backspace</c>, log out, then log in as user. |
|
|
230 | </p> |
|
|
231 | |
|
|
232 | <p> |
|
|
233 | Now, verify that the changes have taken effect: |
|
|
234 | </p> |
|
|
235 | |
|
|
236 | <pre caption="Verify env changes"> |
|
|
237 | $ <i>env | grep -i LC_</i> |
|
|
238 | </pre> |
|
|
239 | |
|
|
240 | <p> |
|
|
241 | There is also additional localisation variable called LINGUAS, which affects |
|
|
242 | to localisation files that get installed in gettext-based programs, and decides |
|
|
243 | used localisation for some specific software packages, such as |
|
|
244 | <c>kde-base/kde-i18n</c> and <c>app-office/openoffice</c>. The variable |
|
|
245 | takes in <e>space</e>-separated list of language codes, and suggested |
|
|
246 | place to set it is <path>/etc/make.conf</path>: |
|
|
247 | </p> |
|
|
248 | |
|
|
249 | <pre caption="setting LINGUAS in make.conf"> |
|
|
250 | # <i>nano -w /etc/make.conf</i> |
|
|
251 | <comment>(Add in the LINGUAS variable. For instance, |
|
|
252 | for German, Finnish and English:)</comment> |
|
|
253 | LINGUAS="de fi en" |
|
|
254 | </pre> |
|
|
255 | |
|
|
256 | |
| 216 | </body> |
257 | </body> |
| 217 | </section> |
258 | </section> |
| 218 | <section> |
259 | <section> |
| 219 | <title>Generating Specific Locales</title> |
260 | <title>Generating Specific Locales</title> |
| 220 | <body> |
261 | <body> |
| … | |
… | |
| 234 | </p> |
275 | </p> |
| 235 | |
276 | |
| 236 | <pre caption="Exporting the LANG variable"> |
277 | <pre caption="Exporting the LANG variable"> |
| 237 | # <i>export LANG="en_US.ISO-8859-15"</i> |
278 | # <i>export LANG="en_US.ISO-8859-15"</i> |
| 238 | </pre> |
279 | </pre> |
|
|
280 | |
|
|
281 | <p> |
|
|
282 | Be sure to update the environment after the change: |
|
|
283 | </p> |
|
|
284 | |
|
|
285 | <pre caption="Update the environment"> |
|
|
286 | # <i>env-update && source /etc/profile</i> |
|
|
287 | </pre> |
|
|
288 | |
|
|
289 | <p> |
|
|
290 | After this, you will need to kill your X server by pressing |
|
|
291 | <c>Ctrl-Alt-Backspace</c>, log out, then log in as user. |
|
|
292 | </p> |
| 239 | |
293 | |
| 240 | </body> |
294 | </body> |
| 241 | </section> |
295 | </section> |
| 242 | <section> |
296 | <section> |
| 243 | <title>The userlocales USE flag</title> |
297 | <title>The userlocales USE flag</title> |
| … | |
… | |
| 314 | <pre caption="setting the X keymap"> |
368 | <pre caption="setting the X keymap"> |
| 315 | Section "InputDevice" |
369 | Section "InputDevice" |
| 316 | Identifier "Keyboard1" |
370 | Identifier "Keyboard1" |
| 317 | ... |
371 | ... |
| 318 | Option "XkbLayout" "de" |
372 | Option "XkbLayout" "de" |
| 319 | # Option "XkbVariant" "nodeadkeys" |
373 | #Option "XkbModel" "pc105" <comment>## this is for international keyboards.</comment> |
|
|
374 | # Option "XkbVariant" "nodeadkeys" <comment>## this would be used for xterm input</comment> |
| 320 | ... |
375 | ... |
| 321 | </pre> |
376 | </pre> |
| 322 | |
377 | |
|
|
378 | <p> |
|
|
379 | If 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 |
|
|
381 | additional keys specific to your keyboard. |
|
|
382 | </p> |
|
|
383 | |
|
|
384 | <p> |
|
|
385 | Deadkeys allow you to press keys that will not show immediately but will be |
|
|
386 | combined with another letter to produce a single character such as é,è,á,à, |
|
|
387 | etc. Setting <c>XkbVariant</c> to <c>nodeadkeys</c> allows input these special |
|
|
388 | characters into X terminals. |
|
|
389 | </p> |
|
|
390 | |
|
|
391 | <p> |
|
|
392 | If you would like to switch between more than one keyboard layout (for example |
|
|
393 | English and Russian), all you have to do is add a few lines to |
|
|
394 | <path>xorg.conf</path> that specify the desired layouts and the shortcut |
|
|
395 | command. |
|
|
396 | </p> |
|
|
397 | |
|
|
398 | <pre caption="Switching between two keyboard layouts"> |
|
|
399 | Section "InputDevice" |
|
|
400 | Identifier "Keyboard1" |
|
|
401 | ... |
|
|
402 | Option "XkbLayout" "us,ru" |
|
|
403 | Option "XkbOptions" "grp:alt_shift_toggle,grp_led:scroll" |
|
|
404 | </pre> |
|
|
405 | |
|
|
406 | <p> |
|
|
407 | Here, <c>XkbOptions</c> allows you to toggle between keyboard layouts by simply |
|
|
408 | pressing <c>Alt-Shift</c>. This will also toggle the Scroll Lock light on or |
|
|
409 | off, thanks to the <c>grp_led:scroll</c> option. This is a handy visual |
|
|
410 | indicator of which keyboard layout you are using at the moment. |
|
|
411 | </p> |
|
|
412 | |
| 323 | </body> |
413 | </body> |
| 324 | </section> |
414 | </section> |
| 325 | </chapter> |
415 | </chapter> |
| 326 | |
416 | |
| 327 | <chapter> |
417 | <chapter> |
| 328 | <title>KDE</title> |
418 | <title>KDE</title> |
| 329 | <section> |
419 | <section> |
| 330 | <body> |
420 | <body> |
| 331 | |
421 | |
| 332 | <p> |
422 | <p> |
| 333 | For KDE you have to install the kde-i18n package with the appropriate |
423 | For KDE you have to install the <c>kde-base/kde-i18n</c> package. Kde-i18n |
| 334 | LINGUAS variable set: |
424 | respects <uri link="#variables">LINGUAS variable</uri> described earlier. |
| 335 | </p> |
|
|
| 336 | |
|
|
| 337 | <pre caption="Install localized KDE"> |
|
|
| 338 | # <i>nano -w /etc/make.conf</i> |
|
|
| 339 | <comment>(Add in the LINGUAS variable. For instance, for the German language:)</comment> |
|
|
| 340 | LINGUAS="de" |
|
|
| 341 | |
|
|
| 342 | <comment>(Now install kde-i18n)</comment> |
|
|
| 343 | # <i>emerge kde-i18n</i> |
|
|
| 344 | </pre> |
425 | </p> |
| 345 | |
426 | |
| 346 | </body> |
427 | </body> |
| 347 | </section> |
428 | </section> |
| 348 | </chapter> |
429 | </chapter> |
| 349 | |
430 | |
| … | |
… | |
| 353 | <body> |
434 | <body> |
| 354 | |
435 | |
| 355 | <p> |
436 | <p> |
| 356 | In order to get your console to display the Euro symbol, you |
437 | In order to get your console to display the Euro symbol, you |
| 357 | will need to set <c>CONSOLEFONT</c> in |
438 | will need to set <c>CONSOLEFONT</c> in |
| 358 | <path>/etc/rc.conf</path> to a file found in |
439 | <path>/etc/conf.d/consolefont</path> to a file found in |
| 359 | <path>/usr/share/consolefonts/</path> (without the |
440 | <path>/usr/share/consolefonts/</path> (without the |
| 360 | <c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol. |
441 | <c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol. |
| 361 | </p> |
442 | </p> |
| 362 | |
443 | |
| 363 | <pre caption="setting the console font"> |
444 | <pre caption="setting the console font"> |
| 364 | CONSOLEFONT="lat9w-16" |
445 | CONSOLEFONT="lat9w-16" |
|
|
446 | </pre> |
|
|
447 | |
|
|
448 | <p> |
|
|
449 | You should verify that <c>CONSOLEFONT</c> is in the boot runlevel: |
|
|
450 | </p> |
|
|
451 | |
|
|
452 | <pre caption="Verify the proper runlevel"> |
|
|
453 | # <i>rc-update show | grep -i consolefont</i> |
|
|
454 | </pre> |
|
|
455 | |
|
|
456 | <p> |
|
|
457 | If no runlevel is displayed for <c>CONSOLEFONT</c>, then add it to the proper level: |
|
|
458 | </p> |
|
|
459 | |
|
|
460 | <pre caption="Add consolefont to boot"> |
|
|
461 | # <i>rc-update add consolefont boot</i> |
| 365 | </pre> |
462 | </pre> |
| 366 | |
463 | |
| 367 | </body> |
464 | </body> |
| 368 | </section> |
465 | </section> |
| 369 | </chapter> |
466 | </chapter> |
| … | |
… | |
| 435 | </note> |
532 | </note> |
| 436 | |
533 | |
| 437 | </body> |
534 | </body> |
| 438 | </section> |
535 | </section> |
| 439 | <section> |
536 | <section> |
| 440 | <title>Language for OpenOffice.org</title> |
537 | <title>OpenOffice.Org</title> |
| 441 | <body> |
538 | <body> |
| 442 | |
539 | |
| 443 | <note> |
|
|
| 444 | Customized default language is not available for openoffice-bin ebuild. The |
|
|
| 445 | default language in the openoffice-bin is ENUS. |
|
|
| 446 | </note> |
|
|
| 447 | |
|
|
| 448 | <p> |
|
|
| 449 | Please note that this package now uses the LINGUAS variable to |
|
|
| 450 | provide localization. The old LANGUAGE=ENUS|PORT system does <e>not</e> work |
|
|
| 451 | anymore. The default language for OpenOffice.org is set as "US English". If you |
|
|
| 452 | wish to change the default language for OpenOffice.org, check the ebuild for the |
|
|
| 453 | default language code. |
|
|
| 454 | </p> |
540 | <p> |
| 455 | |
541 | The current stable <c>app-office/openoffice</c> and |
| 456 | <pre caption="Example: emerge openoffice for german environment"> |
542 | <c>app-office/openoffice-bin</c> ebuilds support the <uri |
| 457 | # <i>nano -w /etc/make.conf</i> |
543 | link="#variables">LINGUAS variable</uri> for selecting installed GUI language |
| 458 | <comment>(Add in the LINGUAS variable. For instance, for the German language:)</comment> |
544 | packs. To see the status of GUI translation, hyphenation, spell checking and |
| 459 | LINGUAS="de" |
545 | other localisations on your language, please refer to <uri |
| 460 | |
546 | link="http://l10n.openoffice.org/languages.html">OpenOffice.Org localisation |
| 461 | <comment>(Now install openoffice)</comment> |
547 | web site</uri>. |
| 462 | # <i>emerge openoffice</i> |
|
|
| 463 | </pre> |
548 | </p> |
| 464 | |
549 | |
| 465 | </body> |
550 | </body> |
| 466 | </section> |
551 | </section> |
| 467 | </chapter> |
552 | </chapter> |
| 468 | |
553 | |