Ticket #2012: i18n-profile-2.diff
File i18n-profile-2.diff, 4.6 KB (added by , 17 years ago) |
---|
-
postlfs/config/profile.xml
332 332 <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary> 333 333 </indexterm> 334 334 335 <para>This script shows how to set some environment variables necessary for 336 native language support. Setting these variables properly gives you:</para> 335 <para>This script sets an environment variable necessary for 336 native language support. A full discussion on determining this 337 variable can be found on the <ulink 338 url="&lfs-root;/chapter07/profile.html">LFS Bash Shell 339 Startup Files</ulink> page.</para> 337 340 338 <itemizedlist>339 <listitem>340 <para>the output of programs translated into your native language</para>341 </listitem>342 <listitem>343 <para>correct classification of characters into letters, digits and344 other classes – this is necessary for <application>Bash</application>345 to accept keystrokes properly in non-English locales</para>346 </listitem>347 <listitem>348 <para>the alphabetical sorting order correct for your country</para>349 </listitem>350 <listitem>351 <para>proper default paper size</para>352 </listitem>353 <listitem>354 <para>correct formatting of monetary, time and date values</para>355 </listitem>356 </itemizedlist>357 358 <para>Replace <replaceable><ll></replaceable> with the two-letter code for359 your language (e.g., <quote>en</quote>) and360 <replaceable><CC></replaceable> with the two-letter code for your country361 (e.g., <quote>GB</quote>). Also you may need to specify (and this is actually362 the preferred form) your character encoding (e.g., <quote>iso8859-1</quote>)363 after a dot (so that the result is <quote>en_GB.iso8859-1</quote>). Issue the364 following command for more information:</para>365 366 <screen><userinput>man 3 setlocale</userinput></screen>367 368 <para>The list of all locales supported by <application>Glibc</application>369 can be obtained by running the following command:</para>370 371 <screen><userinput>locale -a</userinput></screen>372 373 <para>After you are sure about your locale settings, create the374 <filename>/etc/profile.d/i18n.sh</filename> file:</para>375 376 341 <screen role="root"><userinput>cat > /etc/profile.d/i18n.sh << "EOF" 377 342 <literal># Set up i18n variables 378 export LC_ALL=<replaceable><ll></replaceable>_<replaceable><CC></replaceable> 379 export LANG=<replaceable><ll></replaceable>_<replaceable><CC></replaceable> 380 export G_FILENAME_ENCODING=@locale</literal> 343 export LANG=<replaceable><ll></replaceable>_<replaceable><CC></replaceable>.<replaceable><charmap></replaceable><replaceable><@modifiers></replaceable></literal> 381 344 EOF</userinput></screen> 382 345 383 <para>The <envar>LC_ALL</envar> variable sets the same value for all locale384 categories. For better control, you may prefer to set values individually for385 all categories listed in the output of the <command>locale</command>386 command.</para>387 388 <para>The <envar>G_FILENAME_ENCODING</envar> variable tells applications389 such as <application>Glib</application> and <application>GTK+</application>390 that filenames are in the default locale encoding and not in UTF-8 as391 assumed by default.</para>392 393 346 </sect3> 394 347 395 348 <sect3> -
general/genlib/glib2.xml
94 94 95 95 </sect2> 96 96 97 <sect2 role="configuration"> 98 <title>Configuring GLib</title> 99 100 <sect3> 101 <title>Configuration Information</title> 102 103 <para>By default, <application>GLib</application> assumes that all 104 filenames are in the UTF-8 charset. See the <xref 105 linkend="locale-issues"/> page for more details on this kind of 106 issue. In order to tell GLib and applications that use it 107 that filenames are in the default locale encoding, set the variable 108 <envar>G_FILENAME_ENCODING</envar> to the value "@locale":</para> 109 110 <screen><userinput>cat > /etc/profile.d/glib2-locale.sh << "EOF" 111 <literal># Use the current locale charset for filenames 112 # in applications using GLib 113 export G_FILENAME_ENCODING=@locale</literal> 114 EOF</userinput></screen> 115 116 </sect3> 117 118 </sect2> 119 97 120 <sect2 role="content"> 98 121 <title>Contents</title> 99 122