Update to check-0.15.2
[linux_from_scratch.git] / BOOK / chapter08 / gettext.xml
blobcafe26182e8e51b86c12b2c20fa420db4109b621
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4   <!ENTITY % general-entities SYSTEM "../general.ent">
5   %general-entities;
6 ]>
8 <sect1 id="ch-system-gettext" role="wrap">
9   <?dbhtml filename="gettext.html"?>
11   <sect1info condition="script">
12     <productname>gettext</productname>
13     <productnumber>&gettext-version;</productnumber>
14     <address>&gettext-url;</address>
15   </sect1info>
17   <title>Gettext-&gettext-version;</title>
19   <indexterm zone="ch-system-gettext">
20     <primary sortas="a-Gettext">Gettext</primary>
21   </indexterm>
23   <sect2 role="package">
24     <title/>
26     <para>The Gettext package contains utilities for internationalization and
27     localization. These allow programs to be compiled with NLS (Native Language
28     Support), enabling them to output messages in the user's native
29     language.</para>
31     <segmentedlist>
32       <segtitle>&buildtime;</segtitle>
33       <segtitle>&diskspace;</segtitle>
35       <seglistitem>
36         <seg>&gettext-fin-sbu;</seg>
37         <seg>&gettext-fin-du;</seg>
38       </seglistitem>
39     </segmentedlist>
41   </sect2>
43   <sect2 role="installation">
44     <title>Installation of Gettext</title>
46     <para>Prepare Gettext for compilation:</para>
48 <screen><userinput remap="configure">./configure --prefix=/usr    \
49             --disable-static \
50             --docdir=/usr/share/doc/gettext-&gettext-version;</userinput></screen>
52     <para>Compile the package:</para>
54 <!--<screen><userinput remap="make">make BISON_LOCALEDIR=/usr/share/locale</userinput></screen>-->
55 <screen><userinput remap="make">make</userinput></screen>
56 <!--
57    <variablelist>
58       <title>The meaning of the make parameter:</title>
60       <varlistentry>
61         <term><parameter>BISON_LOCALEDIR=/usr/share/locale</parameter></term>
62         <listitem>
63           <para>Since bison is not yet installed in /usr, configure hardcodes
64           the directory containing translations for the bison program (the
65           "locale" directory) as /tools/share/locale. Passing this variable
66            to make allows overriding the choice made by configure.</para>
67         </listitem>
68       </varlistentry>
70     </variablelist>
71 -->
72     <para>To test the results (this takes a long time, around 3 SBUs),
73     issue:</para>
75 <screen><userinput remap="test">make check</userinput></screen>
77     <para>Install the package:</para>
79 <screen><userinput remap="install">make install
80 chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
82   </sect2>
84   <sect2 id="contents-gettext" role="content">
85     <title>Contents of Gettext</title>
87     <segmentedlist>
88       <segtitle>Installed programs</segtitle>
89       <segtitle>Installed libraries</segtitle>
90       <segtitle>Installed directories</segtitle>
92       <seglistitem>
93         <seg>autopoint, envsubst, gettext, gettext.sh,
94         gettextize, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen,
95         msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq,
96         ngettext, recode-sr-latin, and xgettext</seg>
97         <seg>libasprintf.so, libgettextlib.so, libgettextpo.so,
98         libgettextsrc.so, libtextstyle.so, and preloadable_libintl.so</seg>
99         <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;,
100         /usr/share/gettext, and /usr/share/gettext-0.19.8</seg>
101       </seglistitem>
102     </segmentedlist>
104     <variablelist>
105       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
106       <?dbfo list-presentation="list"?>
107       <?dbhtml list-presentation="table"?>
109       <varlistentry id="autopoint">
110         <term><command>autopoint</command></term>
111         <listitem>
112           <para>Copies standard Gettext infrastructure files into a source
113           package</para>
114           <indexterm zone="ch-system-gettext autopoint">
115             <primary sortas="b-autopoint">autopoint</primary>
116           </indexterm>
117         </listitem>
118       </varlistentry>
120       <varlistentry id="envsubst">
121         <term><command>envsubst</command></term>
122         <listitem>
123           <para>Substitutes environment variables in shell format strings</para>
124           <indexterm zone="ch-system-gettext envsubst">
125             <primary sortas="b-envsubst">envsubst</primary>
126           </indexterm>
127         </listitem>
128       </varlistentry>
130       <varlistentry id="gettext">
131         <term><command>gettext</command></term>
132         <listitem>
133           <para>Translates a natural language message into the user's language
134           by looking up the translation in a message catalog</para>
135           <indexterm zone="ch-system-gettext gettext">
136             <primary sortas="b-gettext">gettext</primary>
137           </indexterm>
138         </listitem>
139       </varlistentry>
141       <varlistentry id="gettext.sh">
142         <term><command>gettext.sh</command></term>
143         <listitem>
144           <para>Primarily serves as a shell function library for gettext</para>
145           <indexterm zone="ch-system-gettext gettext.sh">
146             <primary sortas="b-gettext.sh">gettext.sh</primary>
147           </indexterm>
148         </listitem>
149       </varlistentry>
151       <varlistentry id="gettextize">
152         <term><command>gettextize</command></term>
153         <listitem>
154           <para>Copies all standard Gettext files into the given top-level
155           directory of a package to begin internationalizing it</para>
156           <indexterm zone="ch-system-gettext gettextize">
157             <primary sortas="b-gettextize">gettextize</primary>
158           </indexterm>
159         </listitem>
160       </varlistentry>
162       <varlistentry id="msgattrib">
163         <term><command>msgattrib</command></term>
164         <listitem>
165           <para>Filters the messages of a translation catalog according to their
166           attributes and manipulates the attributes</para>
167           <indexterm zone="ch-system-gettext msgattrib">
168             <primary sortas="b-msgattrib">msgattrib</primary>
169           </indexterm>
170         </listitem>
171       </varlistentry>
173       <varlistentry id="msgcat">
174         <term><command>msgcat</command></term>
175         <listitem>
176           <para>Concatenates and merges the given
177           <filename class="extension">.po</filename> files</para>
178           <indexterm zone="ch-system-gettext msgcat">
179             <primary sortas="b-msgcat">msgcat</primary>
180           </indexterm>
181         </listitem>
182       </varlistentry>
184       <varlistentry id="msgcmp">
185         <term><command>msgcmp</command></term>
186         <listitem>
187           <para>Compares two <filename class="extension">.po</filename>
188           files to check that both contain the same set of msgid strings</para>
189           <indexterm zone="ch-system-gettext msgcmp">
190             <primary sortas="b-msgcmp">msgcmp</primary>
191           </indexterm>
192         </listitem>
193       </varlistentry>
195       <varlistentry id="msgcomm">
196         <term><command>msgcomm</command></term>
197         <listitem>
198           <para>Finds the messages that are common to the given
199           <filename class="extension">.po</filename> files</para>
200           <indexterm zone="ch-system-gettext msgcomm">
201             <primary sortas="b-msgcomm">msgcomm</primary>
202           </indexterm>
203         </listitem>
204       </varlistentry>
206       <varlistentry id="msgconv">
207         <term><command>msgconv</command></term>
208         <listitem>
209           <para>Converts a translation catalog to a different character
210           encoding</para>
211           <indexterm zone="ch-system-gettext msgconv">
212             <primary sortas="b-msgconv">msgconv</primary>
213           </indexterm>
214         </listitem>
215       </varlistentry>
217       <varlistentry id="msgen">
218         <term><command>msgen</command></term>
219         <listitem>
220           <para>Creates an English translation catalog</para>
221           <indexterm zone="ch-system-gettext msgen">
222             <primary sortas="b-msgen">msgen</primary>
223           </indexterm>
224         </listitem>
225       </varlistentry>
227       <varlistentry id="msgexec">
228         <term><command>msgexec</command></term>
229         <listitem>
230           <para>Applies a command to all translations of a translation
231           catalog</para>
232           <indexterm zone="ch-system-gettext msgexec">
233             <primary sortas="b-msgexec">msgexec</primary>
234           </indexterm>
235         </listitem>
236       </varlistentry>
238       <varlistentry id="msgfilter">
239         <term><command>msgfilter</command></term>
240         <listitem>
241           <para>Applies a filter to all translations of a translation
242           catalog</para>
243           <indexterm zone="ch-system-gettext msgfilter">
244             <primary sortas="b-msgfilter">msgfilter</primary>
245           </indexterm>
246         </listitem>
247       </varlistentry>
249       <varlistentry id="msgfmt">
250         <term><command>msgfmt</command></term>
251         <listitem>
252           <para>Generates a binary message catalog from a translation
253           catalog</para>
254           <indexterm zone="ch-system-gettext msgfmt">
255             <primary sortas="b-msgfmt">msgfmt</primary>
256           </indexterm>
257         </listitem>
258       </varlistentry>
260       <varlistentry id="msggrep">
261         <term><command>msggrep</command></term>
262         <listitem>
263           <para>Extracts all messages of a translation catalog that match a
264           given pattern or belong to some given source files</para>
265           <indexterm zone="ch-system-gettext msggrep">
266             <primary sortas="b-msggrep">msggrep</primary>
267           </indexterm>
268         </listitem>
269       </varlistentry>
271       <varlistentry id="msginit">
272         <term><command>msginit</command></term>
273         <listitem>
274           <para>Creates a new <filename class="extension">.po</filename> file,
275           initializing the meta information with values from the user's
276           environment</para>
277           <indexterm zone="ch-system-gettext msginit">
278             <primary sortas="b-msginit">msginit</primary>
279           </indexterm>
280         </listitem>
281       </varlistentry>
283       <varlistentry id="msgmerge">
284         <term><command>msgmerge</command></term>
285         <listitem>
286           <para>Combines two raw translations into a single file</para>
287           <indexterm zone="ch-system-gettext msgmerge">
288             <primary sortas="b-msgmerge">msgmerge</primary>
289           </indexterm>
290         </listitem>
291       </varlistentry>
293       <varlistentry id="msgunfmt">
294         <term><command>msgunfmt</command></term>
295         <listitem>
296           <para>Decompiles a binary message catalog into raw translation
297           text</para>
298           <indexterm zone="ch-system-gettext msgunfmt">
299             <primary sortas="b-msgunfmt">msgunfmt</primary>
300           </indexterm>
301         </listitem>
302       </varlistentry>
304       <varlistentry id="msguniq">
305         <term><command>msguniq</command></term>
306         <listitem>
307           <para>Unifies duplicate translations in a translation catalog</para>
308           <indexterm zone="ch-system-gettext msguniq">
309             <primary sortas="b-msguniq">msguniq</primary>
310           </indexterm>
311         </listitem>
312       </varlistentry>
314       <varlistentry id="ngettext">
315         <term><command>ngettext</command></term>
316         <listitem>
317           <para>Displays native language translations of a textual message whose
318           grammatical form depends on a number</para>
319           <indexterm zone="ch-system-gettext ngettext">
320             <primary sortas="b-ngettext">ngettext</primary>
321           </indexterm>
322         </listitem>
323       </varlistentry>
325       <varlistentry id="recode-sr-latin">
326         <term><command>recode-sr-latin</command></term>
327         <listitem>
328           <para>Recodes Serbian text from Cyrillic to Latin script</para>
329           <indexterm zone="ch-system-gettext recode-sr-latin">
330             <primary sortas="b-recode-sr-latin">recode-sr-latin</primary>
331           </indexterm>
332         </listitem>
333       </varlistentry>
335       <varlistentry id="xgettext">
336         <term><command>xgettext</command></term>
337         <listitem>
338           <para>Extracts the translatable message lines from the given source
339           files to make the first translation template</para>
340           <indexterm zone="ch-system-gettext xgettext">
341             <primary sortas="b-xgettext">xgettext</primary>
342           </indexterm>
343         </listitem>
344       </varlistentry>
346       <varlistentry id="libasprintf">
347         <term><filename class="libraryfile">libasprintf</filename></term>
348         <listitem>
349           <para>defines the <emphasis>autosprintf</emphasis> class, which makes
350           C formatted output routines usable in C++ programs, for use with the
351           <emphasis>&lt;string&gt;</emphasis> strings and the
352           <emphasis>&lt;iostream&gt;</emphasis> streams</para>
353           <indexterm zone="ch-system-gettext libasprintf">
354             <primary sortas="c-libasprintf">libasprintf</primary>
355           </indexterm>
356         </listitem>
357       </varlistentry>
359       <varlistentry id="libgettextlib">
360         <term><filename class="libraryfile">libgettextlib</filename></term>
361         <listitem>
362           <para>a private library containing common routines used by the
363           various Gettext programs; these are not intended for general use</para>
364           <indexterm zone="ch-system-gettext libgettextlib">
365             <primary sortas="c-libgettextlib">libgettextlib</primary>
366           </indexterm>
367         </listitem>
368       </varlistentry>
370       <varlistentry id="libgettextpo">
371         <term><filename class="libraryfile">libgettextpo</filename></term>
372         <listitem>
373           <para>Used to write specialized programs that process
374           <filename class="extension">.po</filename> files; this library is
375           used when the standard applications shipped with Gettext (such as
376           <command>msgcomm</command>, <command>msgcmp</command>,
377           <command>msgattrib</command>, and <command>msgen</command>) will
378           not suffice</para>
379           <indexterm zone="ch-system-gettext libgettextpo">
380             <primary sortas="c-libgettextpo">libgettextpo</primary>
381           </indexterm>
382         </listitem>
383       </varlistentry>
385       <varlistentry id="libgettextsrc">
386         <term><filename class="libraryfile">libgettextsrc</filename></term>
387         <listitem>
388           <para>A private library containing common routines used by the
389           various Gettext programs; these are not intended for general use</para>
390           <indexterm zone="ch-system-gettext libgettextsrc">
391             <primary sortas="c-libgettextsrc">libgettextsrc</primary>
392           </indexterm>
393         </listitem>
394       </varlistentry>
396       <varlistentry id="libtextstyle">
397         <term><filename class="libraryfile">libtextstyle</filename></term>
398         <listitem>
399           <para>Text styling library</para>
400           <indexterm zone="ch-system-gettext libtextstyle">
401             <primary sortas="c-libtextstyle">libtextstyle</primary>
402           </indexterm>
403         </listitem>
404       </varlistentry>
406       <varlistentry id="preloadable_libintl">
407         <term><filename class="libraryfile">preloadable_libintl</filename></term>
408         <listitem>
409           <para>A library, intended to be used by LD_PRELOAD that assists
410           <filename class="libraryfile">libintl</filename> in logging
411           untranslated messages</para>
412           <indexterm zone="ch-system-gettext preloadable_libintl">
413             <primary sortas="c-preloadable_libintl">preloadable_libintl</primary>
414           </indexterm>
415         </listitem>
416       </varlistentry>
417     </variablelist>
419   </sect2>
421 </sect1>