aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/gettext.xml
blob: 2c4683804d473faf96abf5c9747dd4fd1bc7b4bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-gettext" role="wrap">
  <?dbhtml filename="gettext.html"?>

  <sect1info condition="script">
    <productname>gettext</productname>
    <productnumber>&gettext-version;</productnumber>
    <address>&gettext-url;</address>
  </sect1info>

  <title>Gettext-&gettext-version;</title>

  <indexterm zone="ch-system-gettext">
    <primary sortas="a-Gettext">Gettext</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The Gettext package contains utilities for internationalization and
    localization. These allow programs to be compiled with NLS (Native Language
    Support), enabling them to output messages in the user's native
    language.</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&gettext-ch6-sbu;</seg>
        <seg>&gettext-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>Installation of Gettext</title>

   <!-- This has been fixed in upstream gnulib, when a new version of
   gettext is released, please check #4055 to see if the change has been
   picked up in this package 
   
   As of April 11, 2018, 'TESTS = test-lock' is in gettext-runtime/tests/Makefile.am
   Perhaps the test is fixed.

   There is no reference to 'test' or TEST in  gettext-tools/gnulib-tests/Makefile.am
   -->
   <!--
   <para>First, suppress two invocations of test-lock which on some machines
   can loop forever:</para>

<screen><userinput remap="pre">sed -i '/^TESTS =/d' gettext-runtime/tests/Makefile.in &amp;&amp;
sed -i 's/test-lock..EXEEXT.//' gettext-tools/gnulib-tests/Makefile.in</userinput></screen>-->

   <!-- As of April 11, 2018 appdata.* is NOT in git master, but appears
   to be in metainfo.{its,loc},  When updating, check BLFS gnome-screenshot. -->

<!--
   <para>Now fix a configuration file:</para>

<screen><userinput remap="pre">sed -e '/AppData/{N;N;p;s/\.appdata\./.metainfo./}' \
    -i gettext-tools/its/appdata.loc</userinput></screen>
-->
    <para>Prepare Gettext for compilation:</para>

<screen><userinput remap="configure">./configure --prefix=/usr    \
            --disable-static \
            --docdir=/usr/share/doc/gettext-&gettext-version;</userinput></screen>

    <para>Compile the package:</para>

<screen><userinput remap="make">make BISON_LOCALEDIR=/usr/share/locale</userinput></screen>

   <variablelist>
      <title>The meaning of the make parameter:</title>

      <varlistentry>
        <term><parameter>BISON_LOCALEDIR=/usr/share/locale</parameter></term>
        <listitem>
          <para>Since bison is not yet installed in /usr, configure hardcodes
          the directory containing translations for the bison program (the
	  "locale" directory) as /tools/share/locale. Passing this variable
           to make allows overriding the choice made by configure.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para>To test the results (this takes a long time, around 3 SBUs),
    issue:</para>

<screen><userinput remap="test">make check</userinput></screen>

    <para>Install the package:</para>

<screen><userinput remap="install">make install
chmod -v 0755 /usr/lib/preloadable_libintl.so</userinput></screen>

  </sect2>

  <sect2 id="contents-gettext" role="content">
    <title>Contents of Gettext</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>
      <segtitle>Installed libraries</segtitle>
      <segtitle>Installed directories</segtitle>

      <seglistitem>
        <seg>autopoint, envsubst, gettext, gettext.sh,
        gettextize, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen,
        msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq,
        ngettext, recode-sr-latin, and xgettext</seg>
        <seg>libasprintf.so, libgettextlib.so, libgettextpo.so,
        libgettextsrc.so, libtextstyle.so, and preloadable_libintl.so</seg>
        <seg>/usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;,
        /usr/share/gettext, and /usr/share/gettext-0.19.8</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="autopoint">
        <term><command>autopoint</command></term>
        <listitem>
          <para>Copies standard Gettext infrastructure files into a source
          package</para>
          <indexterm zone="ch-system-gettext autopoint">
            <primary sortas="b-autopoint">autopoint</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="envsubst">
        <term><command>envsubst</command></term>
        <listitem>
          <para>Substitutes environment variables in shell format strings</para>
          <indexterm zone="ch-system-gettext envsubst">
            <primary sortas="b-envsubst">envsubst</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="gettext">
        <term><command>gettext</command></term>
        <listitem>
          <para>Translates a natural language message into the user's language
          by looking up the translation in a message catalog</para>
          <indexterm zone="ch-system-gettext gettext">
            <primary sortas="b-gettext">gettext</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="gettext.sh">
        <term><command>gettext.sh</command></term>
        <listitem>
          <para>Primarily serves as a shell function library for gettext</para>
          <indexterm zone="ch-system-gettext gettext.sh">
            <primary sortas="b-gettext.sh">gettext.sh</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="gettextize">
        <term><command>gettextize</command></term>
        <listitem>
          <para>Copies all standard Gettext files into the given top-level
          directory of a package to begin internationalizing it</para>
          <indexterm zone="ch-system-gettext gettextize">
            <primary sortas="b-gettextize">gettextize</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgattrib">
        <term><command>msgattrib</command></term>
        <listitem>
          <para>Filters the messages of a translation catalog according to their
          attributes and manipulates the attributes</para>
          <indexterm zone="ch-system-gettext msgattrib">
            <primary sortas="b-msgattrib">msgattrib</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgcat">
        <term><command>msgcat</command></term>
        <listitem>
          <para>Concatenates and merges the given
          <filename class="extension">.po</filename> files</para>
          <indexterm zone="ch-system-gettext msgcat">
            <primary sortas="b-msgcat">msgcat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgcmp">
        <term><command>msgcmp</command></term>
        <listitem>
          <para>Compares two <filename class="extension">.po</filename>
          files to check that both contain the same set of msgid strings</para>
          <indexterm zone="ch-system-gettext msgcmp">
            <primary sortas="b-msgcmp">msgcmp</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgcomm">
        <term><command>msgcomm</command></term>
        <listitem>
          <para>Finds the messages that are common to the given
          <filename class="extension">.po</filename> files</para>
          <indexterm zone="ch-system-gettext msgcomm">
            <primary sortas="b-msgcomm">msgcomm</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgconv">
        <term><command>msgconv</command></term>
        <listitem>
          <para>Converts a translation catalog to a different character
          encoding</para>
          <indexterm zone="ch-system-gettext msgconv">
            <primary sortas="b-msgconv">msgconv</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgen">
        <term><command>msgen</command></term>
        <listitem>
          <para>Creates an English translation catalog</para>
          <indexterm zone="ch-system-gettext msgen">
            <primary sortas="b-msgen">msgen</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgexec">
        <term><command>msgexec</command></term>
        <listitem>
          <para>Applies a command to all translations of a translation
          catalog</para>
          <indexterm zone="ch-system-gettext msgexec">
            <primary sortas="b-msgexec">msgexec</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgfilter">
        <term><command>msgfilter</command></term>
        <listitem>
          <para>Applies a filter to all translations of a translation
          catalog</para>
          <indexterm zone="ch-system-gettext msgfilter">
            <primary sortas="b-msgfilter">msgfilter</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgfmt">
        <term><command>msgfmt</command></term>
        <listitem>
          <para>Generates a binary message catalog from a translation
          catalog</para>
          <indexterm zone="ch-system-gettext msgfmt">
            <primary sortas="b-msgfmt">msgfmt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msggrep">
        <term><command>msggrep</command></term>
        <listitem>
          <para>Extracts all messages of a translation catalog that match a
          given pattern or belong to some given source files</para>
          <indexterm zone="ch-system-gettext msggrep">
            <primary sortas="b-msggrep">msggrep</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msginit">
        <term><command>msginit</command></term>
        <listitem>
          <para>Creates a new <filename class="extension">.po</filename> file,
          initializing the meta information with values from the user's
          environment</para>
          <indexterm zone="ch-system-gettext msginit">
            <primary sortas="b-msginit">msginit</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgmerge">
        <term><command>msgmerge</command></term>
        <listitem>
          <para>Combines two raw translations into a single file</para>
          <indexterm zone="ch-system-gettext msgmerge">
            <primary sortas="b-msgmerge">msgmerge</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msgunfmt">
        <term><command>msgunfmt</command></term>
        <listitem>
          <para>Decompiles a binary message catalog into raw translation
          text</para>
          <indexterm zone="ch-system-gettext msgunfmt">
            <primary sortas="b-msgunfmt">msgunfmt</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="msguniq">
        <term><command>msguniq</command></term>
        <listitem>
          <para>Unifies duplicate translations in a translation catalog</para>
          <indexterm zone="ch-system-gettext msguniq">
            <primary sortas="b-msguniq">msguniq</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ngettext">
        <term><command>ngettext</command></term>
        <listitem>
          <para>Displays native language translations of a textual message whose
          grammatical form depends on a number</para>
          <indexterm zone="ch-system-gettext ngettext">
            <primary sortas="b-ngettext">ngettext</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="recode-sr-latin">
        <term><command>recode-sr-latin</command></term>
        <listitem>
          <para>Recodes Serbian text from Cyrillic to Latin script</para>
          <indexterm zone="ch-system-gettext recode-sr-latin">
            <primary sortas="b-recode-sr-latin">recode-sr-latin</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="xgettext">
        <term><command>xgettext</command></term>
        <listitem>
          <para>Extracts the translatable message lines from the given source
          files to make the first translation template</para>
          <indexterm zone="ch-system-gettext xgettext">
            <primary sortas="b-xgettext">xgettext</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libasprintf">
        <term><filename class="libraryfile">libasprintf</filename></term>
        <listitem>
          <para>defines the <emphasis>autosprintf</emphasis> class, which makes
          C formatted output routines usable in C++ programs, for use with the
          <emphasis>&lt;string&gt;</emphasis> strings and the
          <emphasis>&lt;iostream&gt;</emphasis> streams</para>
          <indexterm zone="ch-system-gettext libasprintf">
            <primary sortas="c-libasprintf">libasprintf</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libgettextlib">
        <term><filename class="libraryfile">libgettextlib</filename></term>
        <listitem>
          <para>a private library containing common routines used by the
          various Gettext programs; these are not intended for general use</para>
          <indexterm zone="ch-system-gettext libgettextlib">
            <primary sortas="c-libgettextlib">libgettextlib</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libgettextpo">
        <term><filename class="libraryfile">libgettextpo</filename></term>
        <listitem>
          <para>Used to write specialized programs that process
          <filename class="extension">.po</filename> files; this library is
          used when the standard applications shipped with Gettext (such as
          <command>msgcomm</command>, <command>msgcmp</command>,
          <command>msgattrib</command>, and <command>msgen</command>) will
          not suffice</para>
          <indexterm zone="ch-system-gettext libgettextpo">
            <primary sortas="c-libgettextpo">libgettextpo</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libgettextsrc">
        <term><filename class="libraryfile">libgettextsrc</filename></term>
        <listitem>
          <para>A private library containing common routines used by the
          various Gettext programs; these are not intended for general use</para>
          <indexterm zone="ch-system-gettext libgettextsrc">
            <primary sortas="c-libgettextsrc">libgettextsrc</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libtextstyle">
        <term><filename class="libraryfile">libtextstyle</filename></term>
        <listitem>
          <para>Text styling library</para>
          <indexterm zone="ch-system-gettext libtextstyle">
            <primary sortas="c-libtextstyle">libtextstyle</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="preloadable_libintl">
        <term><filename class="libraryfile">preloadable_libintl</filename></term>
        <listitem>
          <para>A library, intended to be used by LD_PRELOAD that assists
          <filename class="libraryfile">libintl</filename> in logging
          untranslated messages</para>
          <indexterm zone="ch-system-gettext preloadable_libintl">
            <primary sortas="c-preloadable_libintl">preloadable_libintl</primary>
          </indexterm>
        </listitem>
      </varlistentry>
    </variablelist>

  </sect2>

</sect1>