/[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.54 Revision 1.55
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.54 2009/02/25 21:18:19 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.55 2009/06/14 09:16:34 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">
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>
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<author title="Editor"> 25<author title="Editor">
26 <mail link="nightmorph"/> 26 <mail link="nightmorph"/>
27</author> 27</author>
28 28
29<abstract> 29<abstract>
30This guide should help users localize their Gentoo Linux distribution to any 30This guide should help users localize their Gentoo Linux distribution to any
31European locale. It uses Germany as a case-study, since it is translated from 31European locale. It uses Germany as a case-study, since it is translated from
32the German doc. Includes configuration for use of the euro currency symbol. 32the German doc. Includes configuration for use of the euro currency symbol.
33</abstract> 33</abstract>
34 34
35<version>1.40</version> 35<version>1.41</version>
36<date>2009-02-25</date> 36<date>2009-06-14</date>
37 37
38<chapter> 38<chapter>
39<title>Time zone</title> 39<title>Time zone</title>
40<section> 40<section>
41<body> 41<body>
42 42
43<p> 43<p>
44In order to keep time properly, you need to select your timezone so that your 44In order to keep time properly, you need to select your timezone so that your
45system knows where it is located. Look for your timezone in 45system knows where it is located. Look for your timezone in
46<path>/usr/share/zoneinfo</path>. You then set your timezone in 46<path>/usr/share/zoneinfo</path>. You then set your timezone in
47<path>/etc/conf.d/clock</path>. Please avoid the 47<path>/etc/conf.d/clock</path>. Please avoid the
48<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not 48<path>/usr/share/zoneinfo/Etc/GMT*</path> timezones as their names do not
49indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8. 49indicate the expected zones. For instance, <path>GMT-8</path> is in fact GMT+8.
50</p> 50</p>
51 51
104</chapter> 104</chapter>
105 105
106<chapter> 106<chapter>
107<title>Locale system</title> 107<title>Locale system</title>
108<section> 108<section>
109<title>What are locales?</title> 109<title>What are locales?</title>
110<body> 110<body>
111 111
112<p> 112<p>
113A Locale is a set of information that most programs use for determining country 113A Locale is a set of information that most programs use for determining country
114and language specific settings. The locales and their data are part of the 114and language specific settings. The locales and their data are part of the
115system library and can be found at <path>/usr/share/locale</path> on most 115system library and can be found at <path>/usr/share/locale</path> on most
116systems. A locale name is generally named <c>ab_CD</c> where <c>ab</c> is your 116systems. A locale name is generally named <c>ab_CD</c> where <c>ab</c> is your
117two (or three) letter language code (as specified in ISO-639) and <c>CD</c> is 117two (or three) letter language code (as specified in ISO-639) and <c>CD</c> is
118your two letter country code (as specified in ISO-3166). Variants are often 118your two letter country code (as specified in ISO-3166). Variants are often
119appended to locale names, e.g. <c>en_GB.utf8</c> or <c>de_DE@euro</c>. Please 119appended to locale names, e.g. <c>en_GB.UTF-8</c> or <c>de_DE@euro</c>. Please
120explore <uri link="http://en.wikipedia.org/wiki/Locale">Wikipedia</uri> to read 120explore <uri link="http://en.wikipedia.org/wiki/Locale">Wikipedia</uri> to read
121more about locales and related articles. 121more about locales and related articles.
122</p> 122</p>
123 123
124</body> 124</body>
125</section> 125</section>
126<section id="variables"> 126<section id="variables">
127<title>Environment variables for locales</title> 127<title>Environment variables for locales</title>
128<body> 128<body>
129 129
130<p> 130<p>
131Locale settings are stored in environment variables. These are typically 131Locale settings are stored in environment variables. These are typically
132set in the <path>/etc/env.d/02locale</path> (for system-wide 132set in the <path>/etc/env.d/02locale</path> (for system-wide
133settings) and <path>~/.bashrc</path> (for user-specific settings) file. 133settings) and <path>~/.bashrc</path> (for user-specific settings) file.
134The variables controlling different aspects of locale settings 134The variables controlling different aspects of locale settings
195 <ti> 195 <ti>
196 A special variable for overriding all other settings. 196 A special variable for overriding all other settings.
197 </ti> 197 </ti>
198</tr> 198</tr>
199</table> 199</table>
200 200
201<note> 201<note>
202Some programs are written in such a way that they expect traditional English 202Some programs are written in such a way that they expect traditional English
203ordering of the alphabet, while some locales, most notably the Estonian one, use 203ordering of the alphabet, while some locales, most notably the Estonian one, use
204a different ordering. Therefore it's recommended to explicitly set LC_COLLATE to C 204a different ordering. Therefore it's recommended to explicitly set LC_COLLATE to C
205when dealing with system-wide settings. 205when dealing with system-wide settings.
206</note> 206</note>
207 207
208<warn> 208<warn>
209Using LC_ALL is strongly discouraged as it can't be overridden later on. Please 209Using LC_ALL is strongly discouraged as it can't be overridden later on. Please
210use it only when testing and never set it in a startup file. 210use it only when testing and <e>never</e> set it in a startup file.
211</warn> 211</warn>
212 212
213<p> 213<p>
214Most typically users only set the LANG variable on the global basis: 214Most typically users only set the LANG variable on the global basis. This
215example is for a unicode German locale:
215</p> 216</p>
216 217
217<pre caption="Setting the default system locale in /etc/env.d/02locale"> 218<pre caption="Setting the default system locale in /etc/env.d/02locale">
218LANG="de_DE.utf8@euro" 219LANG="de_DE.UTF-8 UTF-8"
219LC_COLLATE="C" 220LC_COLLATE="C"
220</pre> 221</pre>
221 222
222<note> 223<note>
223Append <c>@euro</c> to your locale if you want to use the Euro 224Use <c>de_DE@euro ISO-8859-15</c> as your LANG if you want to use the Euro
224currency symbol (€) 225currency symbol (€)
225</note> 226</note>
226 227
227<p> 228<p>
228It's also possible, and pretty common especially in a more traditional UNIX 229It's also possible, and pretty common especially in a more traditional UNIX
229environment, to leave the global settings unchanged, i.e. in the "<c>C</c>" 230environment, to leave the global settings unchanged, i.e. in the "<c>C</c>"
230locale. Users can still specify their preferred locale in their own shell RC 231locale. Users can still specify their preferred locale in their own shell RC
231file: 232file:
232</p> 233</p>
233 234
234<pre caption="Setting the user locale in ~/.bashrc"> 235<pre caption="Setting the user locale in ~/.bashrc">
235export LANG="de_DE.utf8@euro" 236export LANG="de_DE.UTF-8 UTF-8"
236export LC_COLLATE="C" 237export LC_COLLATE="C"
237</pre> 238</pre>
238 239
239<p> 240<p>
240Another way of configuring system is to leave it in the default C locale, but 241Another way of configuring system is to leave it in the default C locale, but
241enable UTF-8 character representation at the same time. This option is achieved 242enable UTF-8 character representation at the same time. This option is achieved
242using the following settings in <path>/etc/env.d/02locale</path>: 243using the following settings in <path>/etc/env.d/02locale</path>:
243</p> 244</p>
244 245
245<pre caption="Using traditional C locale while specifying UTF-8"> 246<pre caption="Using traditional C locale while specifying UTF-8">
246LC_CTYPE=de_DE.utf8 247LC_CTYPE=de_DE.UTF-8 UTF-8
247</pre> 248</pre>
248 249
249<p> 250<p>
250Using the above snippet, users will be able to see localized file names 251Using the above snippet, users will be able to see localized file names
251properly, while not being forced to your preferred language. 252properly, while not being forced to your preferred language.
252</p> 253</p>
253 254
254<p> 255<p>
255For message based localization to work in programs that support it, you will 256For message based localization to work in programs that support it, you will
256probably need to have programs compiled with the <c>nls</c> (Native language 257probably need to have programs compiled with the <c>nls</c> (Native language
257support) USE flag set. Most of the programs using nls also need the gettext 258support) USE flag set. Most of the programs using nls also need the gettext
258library to extract and use localized messages. Of course, Portage will 259library to extract and use localized messages. Of course, Portage will
259automatically install it when needed. 260automatically install it when needed.
260</p> 261</p>
261 262
470<p> 471<p>
471For KDE you have to install the <c>kde-base/kde-i18n</c> package. Kde-i18n 472For KDE you have to install the <c>kde-base/kde-i18n</c> package. Kde-i18n
472respects <uri link="#variables">LINGUAS variable</uri> described earlier. 473respects <uri link="#variables">LINGUAS variable</uri> described earlier.
473</p> 474</p>
474 475
475</body> 476</body>
476</section> 477</section>
477</chapter> 478</chapter>
478 479
479<chapter> 480<chapter>
480<title>The Euro Symbol for the Console</title> 481<title>The Euro Symbol for the Console</title>
481<section> 482<section>
482<body> 483<body>
483 484
484<p> 485<p>
485In order to get your console to display the Euro symbol, you 486In order to get your console to display the Euro symbol, you will need to set
486will need to set <c>CONSOLEFONT</c> in
487<path>/etc/conf.d/consolefont</path> to a file found in 487<c>CONSOLEFONT</c> in <path>/etc/conf.d/consolefont</path> to a file found in
488<path>/usr/share/consolefonts/</path> (without the 488<path>/usr/share/consolefonts/</path> (without the <c>.psfu.gz</c>).
489<c>.psfu.gz</c>). <c>lat9w-16</c> has the Euro symbol. 489<c>lat9w-16</c> has the Euro symbol.
490</p> 490</p>
491 491
492<pre caption="Setting the console font"> 492<pre caption="Setting the console font">
493CONSOLEFONT="lat9w-16" 493CONSOLEFONT="lat9w-16"
494</pre> 494</pre>
495 495
496<p> 496<p>
497You should verify that <c>CONSOLEFONT</c> is in the boot runlevel: 497You should verify that <c>CONSOLEFONT</c> is in the boot runlevel:
498</p> 498</p>
499 499
500<pre caption="Verify the proper runlevel"> 500<pre caption="Verify the proper runlevel">
501# <i>rc-update -v show | grep -i consolefont</i> 501# <i>rc-update -v show | grep -i consolefont</i>
502</pre> 502</pre>
503 503
504<p> 504<p>

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

  ViewVC Help
Powered by ViewVC 1.1.20