/[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.34 Revision 1.35
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.34 2005/11/25 20:43:33 jkt Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.35 2006/01/02 13:40:18 rane 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.24</version> 32<version>1.25</version>
33<date>2005-11-25</date> 33<date>2006-01-02</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">
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 (&#8364;)
208</note> 208</note>
209 209
210<p> 210<p>
211For message based localization to work in programs that support it, you will 211For 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 212probably 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 213support) 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 214library to extract and use localized messages. Of course, Gentoo's Portage will
215automatically install it when needed. 215automatically install it when needed.
216</p> 216</p>
217 217
218<p> 218<p>
219Once you have set the right locale, be sure to update your environment
220variables to make your system aware of the change:
221</p>
222
223<pre caption="Update the environment">
224# <i>env-update &amp;&amp; source /etc/profile</i>
225</pre>
226
227<p>
228After 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>
233Now, 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>
219There is also additional localisation variable called LINGUAS, which affects 241There is also additional localisation variable called LINGUAS, which affects
220to localisation files that get installed in gettext-based programs, and decides 242to localisation files that get installed in gettext-based programs, and decides
221used localisation for some specific software packages, such as 243used localisation for some specific software packages, such as
222<c>kde-base/kde-i18n</c> and <c>app-office/openoffice</c>. The variable 244<c>kde-base/kde-i18n</c> and <c>app-office/openoffice</c>. The variable
223takes in <e>space</e>-separated list of language codes, and suggested 245takes in <e>space</e>-separated list of language codes, and suggested
224place to set it is <path>/etc/make.conf</path>: 246place to set it is <path>/etc/make.conf</path>:
225</p> 247</p>
226 248
227<pre caption="setting LINGUAS in make.conf"> 249<pre caption="setting LINGUAS in make.conf">
228# <i>nano -w /etc/make.conf</i> 250# <i>nano -w /etc/make.conf</i>
229<comment>(Add in the LINGUAS variable. For instance, 251<comment>(Add in the LINGUAS variable. For instance,
230for German, Finnish and English:)</comment> 252for German, Finnish and English:)</comment>
231LINGUAS="de fi en" 253LINGUAS="de fi en"
232</pre> 254</pre>
233 255
243<c>localedef</c> to generate your locale. For instance: 265<c>localedef</c> to generate your locale. For instance:
244</p> 266</p>
245 267
246<pre caption="Generating a locale using localedef"> 268<pre caption="Generating a locale using localedef">
247# <i>localedef -c -i en_US -f ISO-8859-15 en_US.ISO-8859-15</i> 269# <i>localedef -c -i en_US -f ISO-8859-15 en_US.ISO-8859-15</i>
248</pre> 270</pre>
249 271
250<p> 272<p>
251After having generated the locale, you can export the LANG variable as you see 273After having generated the locale, you can export the LANG variable as you see
252fit. 274fit.
253</p> 275</p>
254 276
255<pre caption="Exporting the LANG variable"> 277<pre caption="Exporting the LANG variable">
256# <i>export LANG="en_US.ISO-8859-15"</i> 278# <i>export LANG="en_US.ISO-8859-15"</i>
257</pre> 279</pre>
280
281<p>
282Be sure to update the environment after the change:
283</p>
284
285<pre caption="Update the environment">
286# <i>env-update &amp;&amp; source /etc/profile</i>
287</pre>
288
289<p>
290After 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>
258 293
259</body> 294</body>
260</section> 295</section>
261<section> 296<section>
262<title>The userlocales USE flag</title> 297<title>The userlocales USE flag</title>
263<body> 298<body>
264 299
265<p> 300<p>
266You will probably only use one or maybe two locales on your system. Up until now 301You will probably only use one or maybe two locales on your system. Up until now
267after compiling <c>glibc</c> a full set of all available locales has been 302after compiling <c>glibc</c> a full set of all available locales has been
268created. As of now you can activate the <c>userlocales</c> USE flag and specify 303created. As of now you can activate the <c>userlocales</c> USE flag and specify
269only the locales you will need in <path>/etc/locales.build</path>. 304only the locales you will need in <path>/etc/locales.build</path>.
270</p> 305</p>
271 306
272<pre caption="Activate the userlocales USE flag especially for glibc"> 307<pre caption="Activate the userlocales USE flag especially for glibc">
323<title>Keyboard layout for the X server</title> 358<title>Keyboard layout for the X server</title>
324<section> 359<section>
325<body> 360<body>
326 361
327<p> 362<p>
328The keyboard layout to be used by the X server is specified 363The keyboard layout to be used by the X server is specified
329in <path>/etc/X11/xorg.conf</path> by the <c>XkbLayout</c> 364in <path>/etc/X11/xorg.conf</path> by the <c>XkbLayout</c>
330option. 365option.
331</p> 366</p>
332 367
333<pre caption="setting the X keymap"> 368<pre caption="setting the X keymap">
334 Section "InputDevice" 369 Section "InputDevice"
335 Identifier "Keyboard1" 370 Identifier "Keyboard1"
336 ... 371 ...
337 Option "XkbLayout" "de" 372 Option "XkbLayout" "de"
338 # 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>
339 ... 375 ...
340</pre> 376</pre>
377
378<p>
379If 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
381additional keys specific to your keyboard.
382</p>
383
384<p>
385Deadkeys allow you to press keys that will not show immediately but will be
386combined with another letter to produce a single character such as é,è,á,à,
387etc. Setting <c>XkbVariant</c> to <c>nodeadkeys</c> allows input these special
388characters into X terminals.
389</p>
390
391<p>
392If you would like to switch between more than one keyboard layout (for example
393English 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
395command.
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>
407Here, <c>XkbOptions</c> allows you to toggle between keyboard layouts by simply
408pressing <c>Alt-Shift</c>. This will also toggle the Scroll Lock light on or
409off, thanks to the <c>grp_led:scroll</c> option. This is a handy visual
410indicator of which keyboard layout you are using at the moment.
411</p>
341 412
342</body> 413</body>
343</section> 414</section>
344</chapter> 415</chapter>
345 416
346<chapter> 417<chapter>
347<title>KDE</title> 418<title>KDE</title>
348<section> 419<section>
349<body> 420<body>
350 421
351<p> 422<p>
352For KDE you have to install the <c>kde-base/kde-i18n</c> package. Kde-i18n 423For KDE you have to install the <c>kde-base/kde-i18n</c> package. Kde-i18n
353respects <uri link="#variables">LINGUAS variable</uri> described earlier. 424respects <uri link="#variables">LINGUAS variable</uri> described earlier.
354</p> 425</p>
355 426
356</body> 427</body>
357</section> 428</section>
358</chapter> 429</chapter>
359 430
360<chapter> 431<chapter>
361<title>The Euro Symbol for the Console</title> 432<title>The Euro Symbol for the Console</title>
362<section> 433<section>
363<body> 434<body>
364 435
365<p> 436<p>
366In order to get your console to display the Euro symbol, you 437In order to get your console to display the Euro symbol, you
367will need to set <c>CONSOLEFONT</c> in 438will need to set <c>CONSOLEFONT</c> in
368<path>/etc/rc.conf</path> to a file found in 439<path>/etc/conf.d/consolefont</path> to a file found in
369<path>/usr/share/consolefonts/</path> (without the 440<path>/usr/share/consolefonts/</path> (without the
370<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.
371</p> 442</p>
372 443
373<pre caption="setting the console font"> 444<pre caption="setting the console font">
374CONSOLEFONT="lat9w-16" 445CONSOLEFONT="lat9w-16"
446</pre>
447
448<p>
449You 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>
457If 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>
375</pre> 462</pre>
376 463
377</body> 464</body>
378</section> 465</section>
379</chapter> 466</chapter>
380 467
381<chapter> 468<chapter>
382<title>The Euro Symbol in X</title> 469<title>The Euro Symbol in X</title>
383<section> 470<section>
384<title>Most Applications</title> 471<title>Most Applications</title>
385<body> 472<body>
386 473
387<p> 474<p>
388Getting the Euro symbol to work properly in X is a little 475Getting the Euro symbol to work properly in X is a little
389bit tougher. The first thing you should do is change the <c>fixed</c> 476bit tougher. The first thing you should do is change the <c>fixed</c>

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35

  ViewVC Help
Powered by ViewVC 1.1.20