Ticket #2012: i18n-profile.diff

File i18n-profile.diff, 4.5 KB (added by dnicholson@…, 17 years ago)

Proposed new text for i18n.sh section

  • postlfs/config/profile.xml

     
    332332      <primary sortas="e-etc-profile.d-i18n.sh">/etc/profile.d/i18n.sh</primary>
    333333    </indexterm>
    334334
    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>
    337340
    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 and
    344           other classes &ndash; 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>&lt;ll&gt;</replaceable> with the two-letter code for
    359       your language (e.g., <quote>en</quote>) and
    360       <replaceable>&lt;CC&gt;</replaceable> with the two-letter code for your country
    361       (e.g., <quote>GB</quote>). Also you may need to specify (and this is actually
    362       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 the
    364       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 the
    374       <filename>/etc/profile.d/i18n.sh</filename> file:</para>
    375 
    376341<screen role="root"><userinput>cat &gt; /etc/profile.d/i18n.sh &lt;&lt; "EOF"
    377342<literal># Set up i18n variables
    378 export LC_ALL=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>
    379 export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>
    380 export G_FILENAME_ENCODING=@locale</literal>
     343export LANG=<replaceable>&lt;ll&gt;</replaceable>_<replaceable>&lt;CC&gt;</replaceable>.<replaceable>&lt;charmap&gt;</replaceable><replaceable>&lt;@modifiers&gt;</replaceable></literal>
    381344EOF</userinput></screen>
    382345
    383       <para>The <envar>LC_ALL</envar> variable sets the same value for all locale
    384       categories. For better control, you may prefer to set values individually for
    385       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 applications
    389       such as <application>Glib</application> and <application>GTK+</application>
    390       that filenames are in the default locale encoding and not in UTF-8 as
    391       assumed by default.</para>
    392 
    393346    </sect3>
    394347
    395348    <sect3>
  • general/genlib/glib2.xml

     
    9494
    9595  </sect2>
    9696
     97  <sect2 role="configuration">
     98    <title>Configuring GLib</title>
     99
     100    <sect3>
     101      <title>Configuration Information</title>
     102
     103      <para><application>GLib</application> assumes that all filenames
     104      are in the UTF-8 charset. In order to tell GLib and applications
     105      that use it that filenames are in the default locale encoding,
     106      set the variable <envar>G_FILENAME_ENCODING</envar> to the
     107      value @locale:</para>
     108
     109<screen><userinput>cat &gt; /etc/profile.d/glib2-locale.sh &lt;&lt; "EOF"
     110<literal># Use the current locale charset for filenames
     111# in applications using GLib
     112export G_FILENAME_ENCODING=@locale</literal>
     113EOF</userinput></screen>
     114
     115    </sect3>
     116
     117  </sect2>
     118
    97119  <sect2 role="content">
    98120    <title>Contents</title>
    99121