Tag LFS-7.9-systemd-rc2
[linux_from_scratch.git] / chapter06 / gettext.xml
blob1e7177bddd43e72d187afa911540837f6a02ca76
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-ch6-sbu;</seg>
37         <seg>&gettext-ch6-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</userinput></screen>
56     <para>To test the results (this takes a long time, around 3 SBUs),
57     issue:</para>
59 <screen><userinput remap="test">make check</userinput></screen>
61     <para>Nine tests fail due to missing dependencies.</para>
63     <para>Install the package:</para>
65 <screen><userinput remap="install">make install
66 chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
68   </sect2>
70   <sect2 id="contents-gettext" role="content">
71     <title>Contents of Gettext</title>
73     <segmentedlist>
74       <segtitle>Installed programs</segtitle>
75       <segtitle>Installed libraries</segtitle>
76       <segtitle>Installed directories</segtitle>
78       <seglistitem>
79         <seg>autopoint, envsubst, gettext, gettext.sh,
80         gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen,
81         msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq,
82         ngettext, recode-sr-latin, and xgettext</seg>
83         <seg>libasprintf.so, libgettextlib.so, libgettextpo.so,
84         libgettextsrc.so, and preloadable_libintl.so</seg>
85         <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;, and
86         /usr/share/gettext</seg>
87       </seglistitem>
88     </segmentedlist>
90     <variablelist>
91       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
92       <?dbfo list-presentation="list"?>
93       <?dbhtml list-presentation="table"?>
95       <varlistentry id="autopoint">
96         <term><command>autopoint</command></term>
97         <listitem>
98           <para>Copies standard Gettext infrastructure files into a source
99           package</para>
100           <indexterm zone="ch-system-gettext autopoint">
101             <primary sortas="b-autopoint">autopoint</primary>
102           </indexterm>
103         </listitem>
104       </varlistentry>
106       <varlistentry id="envsubst">
107         <term><command>envsubst</command></term>
108         <listitem>
109           <para>Substitutes environment variables in shell format strings</para>
110           <indexterm zone="ch-system-gettext envsubst">
111             <primary sortas="b-envsubst">envsubst</primary>
112           </indexterm>
113         </listitem>
114       </varlistentry>
116       <varlistentry id="gettext">
117         <term><command>gettext</command></term>
118         <listitem>
119           <para>Translates a natural language message into the user's language
120           by looking up the translation in a message catalog</para>
121           <indexterm zone="ch-system-gettext gettext">
122             <primary sortas="b-gettext">gettext</primary>
123           </indexterm>
124         </listitem>
125       </varlistentry>
127       <varlistentry id="gettext.sh">
128         <term><command>gettext.sh</command></term>
129         <listitem>
130           <para>Primarily serves as a shell function library for gettext</para>
131           <indexterm zone="ch-system-gettext gettext.sh">
132             <primary sortas="b-gettext.sh">gettext.sh</primary>
133           </indexterm>
134         </listitem>
135       </varlistentry>
137       <varlistentry id="gettextize">
138         <term><command>gettextize</command></term>
139         <listitem>
140           <para>Copies all standard Gettext files into the given top-level
141           directory of a package to begin internationalizing it</para>
142           <indexterm zone="ch-system-gettext gettextize">
143             <primary sortas="b-gettextize">gettextize</primary>
144           </indexterm>
145         </listitem>
146       </varlistentry>
148       <varlistentry id="hostname-gettext">
149         <term><command>hostname</command></term>
150         <listitem>
151           <para>Displays a network hostname in various forms</para>
152           <indexterm zone="ch-system-gettext hostname-gettext">
153             <primary sortas="b-hostname-gettext">hostname</primary>
154           </indexterm>
155         </listitem>
156       </varlistentry>
158       <varlistentry id="msgattrib">
159         <term><command>msgattrib</command></term>
160         <listitem>
161           <para>Filters the messages of a translation catalog according to their
162           attributes and manipulates the attributes</para>
163           <indexterm zone="ch-system-gettext msgattrib">
164             <primary sortas="b-msgattrib">msgattrib</primary>
165           </indexterm>
166         </listitem>
167       </varlistentry>
169       <varlistentry id="msgcat">
170         <term><command>msgcat</command></term>
171         <listitem>
172           <para>Concatenates and merges the given
173           <filename class="extension">.po</filename> files</para>
174           <indexterm zone="ch-system-gettext msgcat">
175             <primary sortas="b-msgcat">msgcat</primary>
176           </indexterm>
177         </listitem>
178       </varlistentry>
180       <varlistentry id="msgcmp">
181         <term><command>msgcmp</command></term>
182         <listitem>
183           <para>Compares two <filename class="extension">.po</filename>
184           files to check that both contain the same set of msgid strings</para>
185           <indexterm zone="ch-system-gettext msgcmp">
186             <primary sortas="b-msgcmp">msgcmp</primary>
187           </indexterm>
188         </listitem>
189       </varlistentry>
191       <varlistentry id="msgcomm">
192         <term><command>msgcomm</command></term>
193         <listitem>
194           <para>Finds the messages that are common to to the given
195           <filename class="extension">.po</filename> files</para>
196           <indexterm zone="ch-system-gettext msgcomm">
197             <primary sortas="b-msgcomm">msgcomm</primary>
198           </indexterm>
199         </listitem>
200       </varlistentry>
202       <varlistentry id="msgconv">
203         <term><command>msgconv</command></term>
204         <listitem>
205           <para>Converts a translation catalog to a different character
206           encoding</para>
207           <indexterm zone="ch-system-gettext msgconv">
208             <primary sortas="b-msgconv">msgconv</primary>
209           </indexterm>
210         </listitem>
211       </varlistentry>
213       <varlistentry id="msgen">
214         <term><command>msgen</command></term>
215         <listitem>
216           <para>Creates an English translation catalog</para>
217           <indexterm zone="ch-system-gettext msgen">
218             <primary sortas="b-msgen">msgen</primary>
219           </indexterm>
220         </listitem>
221       </varlistentry>
223       <varlistentry id="msgexec">
224         <term><command>msgexec</command></term>
225         <listitem>
226           <para>Applies a command to all translations of a translation
227           catalog</para>
228           <indexterm zone="ch-system-gettext msgexec">
229             <primary sortas="b-msgexec">msgexec</primary>
230           </indexterm>
231         </listitem>
232       </varlistentry>
234       <varlistentry id="msgfilter">
235         <term><command>msgfilter</command></term>
236         <listitem>
237           <para>Applies a filter to all translations of a translation
238           catalog</para>
239           <indexterm zone="ch-system-gettext msgfilter">
240             <primary sortas="b-msgfilter">msgfilter</primary>
241           </indexterm>
242         </listitem>
243       </varlistentry>
245       <varlistentry id="msgfmt">
246         <term><command>msgfmt</command></term>
247         <listitem>
248           <para>Generates a binary message catalog from a translation
249           catalog</para>
250           <indexterm zone="ch-system-gettext msgfmt">
251             <primary sortas="b-msgfmt">msgfmt</primary>
252           </indexterm>
253         </listitem>
254       </varlistentry>
256       <varlistentry id="msggrep">
257         <term><command>msggrep</command></term>
258         <listitem>
259           <para>Extracts all messages of a translation catalog that match a
260           given pattern or belong to some given source files</para>
261           <indexterm zone="ch-system-gettext msggrep">
262             <primary sortas="b-msggrep">msggrep</primary>
263           </indexterm>
264         </listitem>
265       </varlistentry>
267       <varlistentry id="msginit">
268         <term><command>msginit</command></term>
269         <listitem>
270           <para>Creates a new <filename class="extension">.po</filename> file,
271           initializing the meta information with values from the user's
272           environment</para>
273           <indexterm zone="ch-system-gettext msginit">
274             <primary sortas="b-msginit">msginit</primary>
275           </indexterm>
276         </listitem>
277       </varlistentry>
279       <varlistentry id="msgmerge">
280         <term><command>msgmerge</command></term>
281         <listitem>
282           <para>Combines two raw translations into a single file</para>
283           <indexterm zone="ch-system-gettext msgmerge">
284             <primary sortas="b-msgmerge">msgmerge</primary>
285           </indexterm>
286         </listitem>
287       </varlistentry>
289       <varlistentry id="msgunfmt">
290         <term><command>msgunfmt</command></term>
291         <listitem>
292           <para>Decompiles a binary message catalog into raw translation
293           text</para>
294           <indexterm zone="ch-system-gettext msgunfmt">
295             <primary sortas="b-msgunfmt">msgunfmt</primary>
296           </indexterm>
297         </listitem>
298       </varlistentry>
300       <varlistentry id="msguniq">
301         <term><command>msguniq</command></term>
302         <listitem>
303           <para>Unifies duplicate translations in a translation catalog</para>
304           <indexterm zone="ch-system-gettext msguniq">
305             <primary sortas="b-msguniq">msguniq</primary>
306           </indexterm>
307         </listitem>
308       </varlistentry>
310       <varlistentry id="ngettext">
311         <term><command>ngettext</command></term>
312         <listitem>
313           <para>Displays native language translations of a textual message whose
314           grammatical form depends on a number</para>
315           <indexterm zone="ch-system-gettext ngettext">
316             <primary sortas="b-ngettext">ngettext</primary>
317           </indexterm>
318         </listitem>
319       </varlistentry>
321       <varlistentry id="recode-sr-latin">
322         <term><command>recode-sr-latin</command></term>
323         <listitem>
324           <para>Recodes Serbian text from Cyrillic to Latin script</para>
325           <indexterm zone="ch-system-gettext recode-sr-latin">
326             <primary sortas="b-recode-sr-latin">recode-sr-latin</primary>
327           </indexterm>
328         </listitem>
329       </varlistentry>
331       <varlistentry id="xgettext">
332         <term><command>xgettext</command></term>
333         <listitem>
334           <para>Extracts the translatable message lines from the given source
335           files to make the first translation template</para>
336           <indexterm zone="ch-system-gettext xgettext">
337             <primary sortas="b-xgettext">xgettext</primary>
338           </indexterm>
339         </listitem>
340       </varlistentry>
342       <varlistentry id="libasprintf">
343         <term><filename class="libraryfile">libasprintf</filename></term>
344         <listitem>
345           <para>defines the <emphasis>autosprintf</emphasis> class, which makes
346           C formatted output routines usable in C++ programs, for use with the
347           <emphasis>&lt;string&gt;</emphasis> strings and the
348           <emphasis>&lt;iostream&gt;</emphasis> streams</para>
349           <indexterm zone="ch-system-gettext libasprintf">
350             <primary sortas="c-libasprintf">libasprintf</primary>
351           </indexterm>
352         </listitem>
353       </varlistentry>
355       <varlistentry id="libgettextlib">
356         <term><filename class="libraryfile">libgettextlib</filename></term>
357         <listitem>
358           <para>a private library containing common routines used by the
359           various Gettext programs; these are not intended for general use</para>
360           <indexterm zone="ch-system-gettext libgettextlib">
361             <primary sortas="c-libgettextlib">libgettextlib</primary>
362           </indexterm>
363         </listitem>
364       </varlistentry>
366       <varlistentry id="libgettextpo">
367         <term><filename class="libraryfile">libgettextpo</filename></term>
368         <listitem>
369           <para>Used to write specialized programs that process
370           <filename class="extension">.po</filename> files; this library is
371           used when the standard applications shipped with Gettext (such as
372           <command>msgcomm</command>, <command>msgcmp</command>,
373           <command>msgattrib</command>, and <command>msgen</command>) will
374           not suffice</para>
375           <indexterm zone="ch-system-gettext libgettextpo">
376             <primary sortas="c-libgettextpo">libgettextpo</primary>
377           </indexterm>
378         </listitem>
379       </varlistentry>
381       <varlistentry id="libgettextsrc">
382         <term><filename class="libraryfile">libgettextsrc</filename></term>
383         <listitem>
384           <para>A private library containing common routines used by the
385           various Gettext programs; these are not intended for general use</para>
386           <indexterm zone="ch-system-gettext libgettextsrc">
387             <primary sortas="c-libgettextsrc">libgettextsrc</primary>
388           </indexterm>
389         </listitem>
390       </varlistentry>
392       <varlistentry id="preloadable_libintl">
393         <term><filename class="libraryfile">preloadable_libintl</filename></term>
394         <listitem>
395           <para>A library, intended to be used by LD_PRELOAD that assists
396           <filename class="libraryfile">libintl</filename> in logging
397           untranslated messages</para>
398           <indexterm zone="ch-system-gettext preloadable_libintl">
399             <primary sortas="c-preloadable_libintl">preloadable_libintl</primary>
400           </indexterm>
401         </listitem>
402       </varlistentry>
403     </variablelist>
405   </sect2>
407 </sect1>