/[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.48 Revision 1.49
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.48 2007/10/04 20:19:59 neysx Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/guide-localization.xml,v 1.49 2008/10/10 16:03:49 jkt 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">
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.36</version> 32<version>1.37</version>
33<date>2007-10-04</date> 33<date>2008-10-10</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>
135<tr> 135<tr>
136 <th>Variable name</th> 136 <th>Variable name</th>
137 <th>Explanation</th> 137 <th>Explanation</th>
138</tr> 138</tr>
139<tr> 139<tr>
140 <ti>LC_ALL</ti> 140 <ti>LANG</ti>
141 <ti> 141 <ti>
142 Define all locale settings at once. This is the top level setting for 142 Defines all locale settings at once, while allowing further individual
143 locales which will override any other setting. 143 customization via the LC_* settings below.
144 </ti> 144 </ti>
145</tr> 145</tr>
146<tr> 146<tr>
147 <ti>LC_COLLATE</ti> 147 <ti>LC_COLLATE</ti>
148 <ti> 148 <ti>
184<tr> 184<tr>
185 <ti>LC_PAPER</ti> 185 <ti>LC_PAPER</ti>
186 <ti>Defines default paper size.</ti> 186 <ti>Defines default paper size.</ti>
187</tr> 187</tr>
188<tr> 188<tr>
189 <ti>LANG</ti> 189 <ti>LC_ALL</ti>
190 <ti> 190 <ti>
191 Defines all locale settings at once. This setting can be overridden by 191 A special variable for overriding all other settings.
192 individual LC_* settings above or even by LC_ALL.
193 </ti> 192 </ti>
194</tr> 193</tr>
195</table> 194</table>
196 195
197<note> 196<note>
198Even though most programs work with LC_ALL only, some of them misbehave if 197Some programs are written in such a way that they expect traditional English
199LC_ALL is set but LANG isn't. If you want to play safe, set them <e>both</e>. 198ordering of the alphabet, while some locales, most notably the Estonian one, use
199a different ordering. Therefore it's recommended to explicitly set LC_COLLATE to C
200when dealing with system-wide settings.
200</note> 201</note>
201 202
202<p> 203<warn>
203Most typically users only set the LANG variable and perhaps LC_CTYPE variable 204For the same reason, using LC_ALL is strongly discouraged. Please use it only
204on user level by adding definitions to shells startup files defining 205when testing and never set it in a startup file.
205the environment variable manually from command line: 206</warn>
207
206</p> 208<p>
209Most typically users only set the LANG variable on the global basis:
210</p>
207 211
208<pre caption="Setting the user locale in ~/.bashrc"> 212<pre caption="Setting the default system locale in /etc/env.d/02locale">
209export LANG="de_DE@euro" 213LANG="de_DE.utf8@euro"
214LC_COLLATE="C"
210</pre> 215</pre>
211 216
212<note> 217<note>
213Append <c>@euro</c> to your locale if you want to use the Euro 218Append <c>@euro</c> to your locale if you want to use the Euro
214currency symbol (€) 219currency symbol (€)
215</note> 220</note>
216 221
217<p> 222<p>
218It is also possible to set a system-wide locale for all users and programs: 223It's also possible, and pretty common especially in a more traditional UNIX
219</p> 224environment, to leave the global settings unchanged, i.e. in the "<c>C</c>"
220 225locale. Users can still specify their preferred locale in their own shell RC
221<pre caption="Setting the default system locale in /etc/env.d/02locale"> 226file:
222LC_ALL="de_DE@euro"
223LANG="de_DE@euro"
224</pre>
225
226<p> 227</p>
227A common practice is to use only per user locale settings and leave the 228
228default system locale unset. In this case system locale defaults to a 229<pre caption="Setting the user locale in ~/.bashrc">
229special value <c>"C"</c>, which for historical reasons maps to the English 230export LANG="de_DE.utf8@euro"
230locale. 231export LC_COLLATE="C"
232</pre>
233
234<p>
235Another way of configuring system is to leave it in the default C locale, but
236enable UTF-8 character representation at the same time. This option is achieved
237using the following settings in <path>/etc/env.d/02locale</path>:
238</p>
239
240<pre caption="Using traditional C locale while specifying UTF-8">
241LC_CTYPE=de_DE.utf8
242</pre>
243
244<p>
245Using the above snippet, users will be able to see localized file names
246properly, while not being forced to your preferred language.
231</p> 247</p>
232 248
233<p> 249<p>
234For message based localization to work in programs that support it, you will 250For message based localization to work in programs that support it, you will
235probably need to have programs compiled with the <c>nls</c> (Native language 251probably need to have programs compiled with the <c>nls</c> (Native language
259<p> 275<p>
260Now, verify that the changes have taken effect: 276Now, verify that the changes have taken effect:
261</p> 277</p>
262 278
263<pre caption="Verify env changes"> 279<pre caption="Verify env changes">
264$ <i>env | grep -i LC_</i> 280$ <i>locale</i>
265</pre> 281</pre>
266 282
267<p> 283<p>
268There is also additional localisation variable called LINGUAS, which affects 284There is also additional localisation variable called LINGUAS, which affects
269to localisation files that get installed in gettext-based programs, and decides 285to localisation files that get installed in gettext-based programs, and decides

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.20