Add some minor text tweaks
[linux_from_scratch.git] / chapter06 / gettext.xml
blob6cd3e1a4f7109c4557f3d67f26d5fc291c22fa30
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    <!-- This has been fixed in upstream gnulib, when a new version of
47    gettext is released, please check #4055 to see if the change has been
48    picked up in this package 
49    
50    As of April 11, 2018, 'TESTS = test-lock' is in gettext-runtime/tests/Makefile.am
51    Perhaps the test is fixed.
53    There is no reference to 'test' or TEST in  gettext-tools/gnulib-tests/Makefile.am
54    -->
55    <para>First, suppress two invocations of test-lock which on some machines
56    can loop forever:</para>
58 <screen><userinput remap="pre">sed -i '/^TESTS =/d' gettext-runtime/tests/Makefile.in &amp;&amp;
59 sed -i 's/test-lock..EXEEXT.//' gettext-tools/gnulib-tests/Makefile.in</userinput></screen>
61    <!-- As of April 11, 2018 appdata.* is NOT in git master, but appears
62    to be in metainfo.{its,loc},  When updating, check BLFS gnome-screenshot. -->
63    <para>Now fix a configuration file:</para>
65 <screen><userinput remap="pre">sed -e '/AppData/{N;N;p;s/\.appdata\./.metainfo./}' \
66     -i gettext-tools/its/appdata.loc</userinput></screen>
68     <para>Prepare Gettext for compilation:</para>
70 <screen><userinput remap="configure">./configure --prefix=/usr    \
71             --disable-static \
72             --docdir=/usr/share/doc/gettext-&gettext-version;</userinput></screen>
74     <para>Compile the package:</para>
76 <screen><userinput remap="make">make</userinput></screen>
78     <para>To test the results (this takes a long time, around 3 SBUs),
79     issue:</para>
81 <screen><userinput remap="test">make check</userinput></screen>
83     <para>Install the package:</para>
85 <screen><userinput remap="install">make install
86 chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>
88   </sect2>
90   <sect2 id="contents-gettext" role="content">
91     <title>Contents of Gettext</title>
93     <segmentedlist>
94       <segtitle>Installed programs</segtitle>
95       <segtitle>Installed libraries</segtitle>
96       <segtitle>Installed directories</segtitle>
98       <seglistitem>
99         <seg>autopoint, envsubst, gettext, gettext.sh,
100         gettextize, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen,
101         msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq,
102         ngettext, recode-sr-latin, and xgettext</seg>
103         <seg>libasprintf.so, libgettextlib.so, libgettextpo.so,
104         libgettextsrc.so, and preloadable_libintl.so</seg>
105         <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;, and
106         /usr/share/gettext</seg>
107       </seglistitem>
108     </segmentedlist>
110     <variablelist>
111       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
112       <?dbfo list-presentation="list"?>
113       <?dbhtml list-presentation="table"?>
115       <varlistentry id="autopoint">
116         <term><command>autopoint</command></term>
117         <listitem>
118           <para>Copies standard Gettext infrastructure files into a source
119           package</para>
120           <indexterm zone="ch-system-gettext autopoint">
121             <primary sortas="b-autopoint">autopoint</primary>
122           </indexterm>
123         </listitem>
124       </varlistentry>
126       <varlistentry id="envsubst">
127         <term><command>envsubst</command></term>
128         <listitem>
129           <para>Substitutes environment variables in shell format strings</para>
130           <indexterm zone="ch-system-gettext envsubst">
131             <primary sortas="b-envsubst">envsubst</primary>
132           </indexterm>
133         </listitem>
134       </varlistentry>
136       <varlistentry id="gettext">
137         <term><command>gettext</command></term>
138         <listitem>
139           <para>Translates a natural language message into the user's language
140           by looking up the translation in a message catalog</para>
141           <indexterm zone="ch-system-gettext gettext">
142             <primary sortas="b-gettext">gettext</primary>
143           </indexterm>
144         </listitem>
145       </varlistentry>
147       <varlistentry id="gettext.sh">
148         <term><command>gettext.sh</command></term>
149         <listitem>
150           <para>Primarily serves as a shell function library for gettext</para>
151           <indexterm zone="ch-system-gettext gettext.sh">
152             <primary sortas="b-gettext.sh">gettext.sh</primary>
153           </indexterm>
154         </listitem>
155       </varlistentry>
157       <varlistentry id="gettextize">
158         <term><command>gettextize</command></term>
159         <listitem>
160           <para>Copies all standard Gettext files into the given top-level
161           directory of a package to begin internationalizing it</para>
162           <indexterm zone="ch-system-gettext gettextize">
163             <primary sortas="b-gettextize">gettextize</primary>
164           </indexterm>
165         </listitem>
166       </varlistentry>
168       <varlistentry id="msgattrib">
169         <term><command>msgattrib</command></term>
170         <listitem>
171           <para>Filters the messages of a translation catalog according to their
172           attributes and manipulates the attributes</para>
173           <indexterm zone="ch-system-gettext msgattrib">
174             <primary sortas="b-msgattrib">msgattrib</primary>
175           </indexterm>
176         </listitem>
177       </varlistentry>
179       <varlistentry id="msgcat">
180         <term><command>msgcat</command></term>
181         <listitem>
182           <para>Concatenates and merges the given
183           <filename class="extension">.po</filename> files</para>
184           <indexterm zone="ch-system-gettext msgcat">
185             <primary sortas="b-msgcat">msgcat</primary>
186           </indexterm>
187         </listitem>
188       </varlistentry>
190       <varlistentry id="msgcmp">
191         <term><command>msgcmp</command></term>
192         <listitem>
193           <para>Compares two <filename class="extension">.po</filename>
194           files to check that both contain the same set of msgid strings</para>
195           <indexterm zone="ch-system-gettext msgcmp">
196             <primary sortas="b-msgcmp">msgcmp</primary>
197           </indexterm>
198         </listitem>
199       </varlistentry>
201       <varlistentry id="msgcomm">
202         <term><command>msgcomm</command></term>
203         <listitem>
204           <para>Finds the messages that are common to the given
205           <filename class="extension">.po</filename> files</para>
206           <indexterm zone="ch-system-gettext msgcomm">
207             <primary sortas="b-msgcomm">msgcomm</primary>
208           </indexterm>
209         </listitem>
210       </varlistentry>
212       <varlistentry id="msgconv">
213         <term><command>msgconv</command></term>
214         <listitem>
215           <para>Converts a translation catalog to a different character
216           encoding</para>
217           <indexterm zone="ch-system-gettext msgconv">
218             <primary sortas="b-msgconv">msgconv</primary>
219           </indexterm>
220         </listitem>
221       </varlistentry>
223       <varlistentry id="msgen">
224         <term><command>msgen</command></term>
225         <listitem>
226           <para>Creates an English translation catalog</para>
227           <indexterm zone="ch-system-gettext msgen">
228             <primary sortas="b-msgen">msgen</primary>
229           </indexterm>
230         </listitem>
231       </varlistentry>
233       <varlistentry id="msgexec">
234         <term><command>msgexec</command></term>
235         <listitem>
236           <para>Applies a command to all translations of a translation
237           catalog</para>
238           <indexterm zone="ch-system-gettext msgexec">
239             <primary sortas="b-msgexec">msgexec</primary>
240           </indexterm>
241         </listitem>
242       </varlistentry>
244       <varlistentry id="msgfilter">
245         <term><command>msgfilter</command></term>
246         <listitem>
247           <para>Applies a filter to all translations of a translation
248           catalog</para>
249           <indexterm zone="ch-system-gettext msgfilter">
250             <primary sortas="b-msgfilter">msgfilter</primary>
251           </indexterm>
252         </listitem>
253       </varlistentry>
255       <varlistentry id="msgfmt">
256         <term><command>msgfmt</command></term>
257         <listitem>
258           <para>Generates a binary message catalog from a translation
259           catalog</para>
260           <indexterm zone="ch-system-gettext msgfmt">
261             <primary sortas="b-msgfmt">msgfmt</primary>
262           </indexterm>
263         </listitem>
264       </varlistentry>
266       <varlistentry id="msggrep">
267         <term><command>msggrep</command></term>
268         <listitem>
269           <para>Extracts all messages of a translation catalog that match a
270           given pattern or belong to some given source files</para>
271           <indexterm zone="ch-system-gettext msggrep">
272             <primary sortas="b-msggrep">msggrep</primary>
273           </indexterm>
274         </listitem>
275       </varlistentry>
277       <varlistentry id="msginit">
278         <term><command>msginit</command></term>
279         <listitem>
280           <para>Creates a new <filename class="extension">.po</filename> file,
281           initializing the meta information with values from the user's
282           environment</para>
283           <indexterm zone="ch-system-gettext msginit">
284             <primary sortas="b-msginit">msginit</primary>
285           </indexterm>
286         </listitem>
287       </varlistentry>
289       <varlistentry id="msgmerge">
290         <term><command>msgmerge</command></term>
291         <listitem>
292           <para>Combines two raw translations into a single file</para>
293           <indexterm zone="ch-system-gettext msgmerge">
294             <primary sortas="b-msgmerge">msgmerge</primary>
295           </indexterm>
296         </listitem>
297       </varlistentry>
299       <varlistentry id="msgunfmt">
300         <term><command>msgunfmt</command></term>
301         <listitem>
302           <para>Decompiles a binary message catalog into raw translation
303           text</para>
304           <indexterm zone="ch-system-gettext msgunfmt">
305             <primary sortas="b-msgunfmt">msgunfmt</primary>
306           </indexterm>
307         </listitem>
308       </varlistentry>
310       <varlistentry id="msguniq">
311         <term><command>msguniq</command></term>
312         <listitem>
313           <para>Unifies duplicate translations in a translation catalog</para>
314           <indexterm zone="ch-system-gettext msguniq">
315             <primary sortas="b-msguniq">msguniq</primary>
316           </indexterm>
317         </listitem>
318       </varlistentry>
320       <varlistentry id="ngettext">
321         <term><command>ngettext</command></term>
322         <listitem>
323           <para>Displays native language translations of a textual message whose
324           grammatical form depends on a number</para>
325           <indexterm zone="ch-system-gettext ngettext">
326             <primary sortas="b-ngettext">ngettext</primary>
327           </indexterm>
328         </listitem>
329       </varlistentry>
331       <varlistentry id="recode-sr-latin">
332         <term><command>recode-sr-latin</command></term>
333         <listitem>
334           <para>Recodes Serbian text from Cyrillic to Latin script</para>
335           <indexterm zone="ch-system-gettext recode-sr-latin">
336             <primary sortas="b-recode-sr-latin">recode-sr-latin</primary>
337           </indexterm>
338         </listitem>
339       </varlistentry>
341       <varlistentry id="xgettext">
342         <term><command>xgettext</command></term>
343         <listitem>
344           <para>Extracts the translatable message lines from the given source
345           files to make the first translation template</para>
346           <indexterm zone="ch-system-gettext xgettext">
347             <primary sortas="b-xgettext">xgettext</primary>
348           </indexterm>
349         </listitem>
350       </varlistentry>
352       <varlistentry id="libasprintf">
353         <term><filename class="libraryfile">libasprintf</filename></term>
354         <listitem>
355           <para>defines the <emphasis>autosprintf</emphasis> class, which makes
356           C formatted output routines usable in C++ programs, for use with the
357           <emphasis>&lt;string&gt;</emphasis> strings and the
358           <emphasis>&lt;iostream&gt;</emphasis> streams</para>
359           <indexterm zone="ch-system-gettext libasprintf">
360             <primary sortas="c-libasprintf">libasprintf</primary>
361           </indexterm>
362         </listitem>
363       </varlistentry>
365       <varlistentry id="libgettextlib">
366         <term><filename class="libraryfile">libgettextlib</filename></term>
367         <listitem>
368           <para>a private library containing common routines used by the
369           various Gettext programs; these are not intended for general use</para>
370           <indexterm zone="ch-system-gettext libgettextlib">
371             <primary sortas="c-libgettextlib">libgettextlib</primary>
372           </indexterm>
373         </listitem>
374       </varlistentry>
376       <varlistentry id="libgettextpo">
377         <term><filename class="libraryfile">libgettextpo</filename></term>
378         <listitem>
379           <para>Used to write specialized programs that process
380           <filename class="extension">.po</filename> files; this library is
381           used when the standard applications shipped with Gettext (such as
382           <command>msgcomm</command>, <command>msgcmp</command>,
383           <command>msgattrib</command>, and <command>msgen</command>) will
384           not suffice</para>
385           <indexterm zone="ch-system-gettext libgettextpo">
386             <primary sortas="c-libgettextpo">libgettextpo</primary>
387           </indexterm>
388         </listitem>
389       </varlistentry>
391       <varlistentry id="libgettextsrc">
392         <term><filename class="libraryfile">libgettextsrc</filename></term>
393         <listitem>
394           <para>A private library containing common routines used by the
395           various Gettext programs; these are not intended for general use</para>
396           <indexterm zone="ch-system-gettext libgettextsrc">
397             <primary sortas="c-libgettextsrc">libgettextsrc</primary>
398           </indexterm>
399         </listitem>
400       </varlistentry>
402       <varlistentry id="preloadable_libintl">
403         <term><filename class="libraryfile">preloadable_libintl</filename></term>
404         <listitem>
405           <para>A library, intended to be used by LD_PRELOAD that assists
406           <filename class="libraryfile">libintl</filename> in logging
407           untranslated messages</para>
408           <indexterm zone="ch-system-gettext preloadable_libintl">
409             <primary sortas="c-preloadable_libintl">preloadable_libintl</primary>
410           </indexterm>
411         </listitem>
412       </varlistentry>
413     </variablelist>
415   </sect2>
417 </sect1>