1<HTML>
2<HEAD>
3<!-- This HTML file has been created by texi2html 1.52b
4     from gettext.texi on 29 December 2011 -->
5
6<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
7<TITLE>GNU gettext utilities - 5  Making the PO Template File</TITLE>
8</HEAD>
9<BODY>
10Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_4.html">previous</A>, <A HREF="gettext_6.html">next</A>, <A HREF="gettext_25.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
11<P><HR><P>
12
13
14<H1><A NAME="SEC27" HREF="gettext_toc.html#TOC27">5  Making the PO Template File</A></H1>
15<P>
16<A NAME="IDX153"></A>
17
18</P>
19<P>
20After preparing the sources, the programmer creates a PO template file.
21This section explains how to use <CODE>xgettext</CODE> for this purpose.
22
23</P>
24<P>
25<CODE>xgettext</CODE> creates a file named <TT>&lsquo;<VAR>domainname</VAR>.po&rsquo;</TT>.  You
26should then rename it to <TT>&lsquo;<VAR>domainname</VAR>.pot&rsquo;</TT>.  (Why doesn't
27<CODE>xgettext</CODE> create it under the name <TT>&lsquo;<VAR>domainname</VAR>.pot&rsquo;</TT>
28right away?  The answer is: for historical reasons.  When <CODE>xgettext</CODE>
29was specified, the distinction between a PO file and PO file template
30was fuzzy, and the suffix <SAMP>&lsquo;.pot&rsquo;</SAMP> wasn't in use at that time.)
31
32</P>
33
34
35
36<H2><A NAME="SEC28" HREF="gettext_toc.html#TOC28">5.1  Invoking the <CODE>xgettext</CODE> Program</A></H2>
37
38<P>
39<A NAME="IDX154"></A>
40<A NAME="IDX155"></A>
41
42<PRE>
43xgettext [<VAR>option</VAR>] [<VAR>inputfile</VAR>] ...
44</PRE>
45
46<P>
47The <CODE>xgettext</CODE> program extracts translatable strings from given
48input files.
49
50</P>
51
52
53<H3><A NAME="SEC29" HREF="gettext_toc.html#TOC29">5.1.1  Input file location</A></H3>
54
55<DL COMPACT>
56
57<DT><SAMP>&lsquo;<VAR>inputfile</VAR> ...&rsquo;</SAMP>
58<DD>
59Input files.
60
61<DT><SAMP>&lsquo;-f <VAR>file</VAR>&rsquo;</SAMP>
62<DD>
63<DT><SAMP>&lsquo;--files-from=<VAR>file</VAR>&rsquo;</SAMP>
64<DD>
65<A NAME="IDX156"></A>
66<A NAME="IDX157"></A>
67Read the names of the input files from <VAR>file</VAR> instead of getting
68them from the command line.
69
70<DT><SAMP>&lsquo;-D <VAR>directory</VAR>&rsquo;</SAMP>
71<DD>
72<DT><SAMP>&lsquo;--directory=<VAR>directory</VAR>&rsquo;</SAMP>
73<DD>
74<A NAME="IDX158"></A>
75<A NAME="IDX159"></A>
76Add <VAR>directory</VAR> to the list of directories.  Source files are
77searched relative to this list of directories.  The resulting <TT>&lsquo;.po&rsquo;</TT>
78file will be written relative to the current directory, though.
79
80</DL>
81
82<P>
83If <VAR>inputfile</VAR> is <SAMP>&lsquo;-&rsquo;</SAMP>, standard input is read.
84
85</P>
86
87
88<H3><A NAME="SEC30" HREF="gettext_toc.html#TOC30">5.1.2  Output file location</A></H3>
89
90<DL COMPACT>
91
92<DT><SAMP>&lsquo;-d <VAR>name</VAR>&rsquo;</SAMP>
93<DD>
94<DT><SAMP>&lsquo;--default-domain=<VAR>name</VAR>&rsquo;</SAMP>
95<DD>
96<A NAME="IDX160"></A>
97<A NAME="IDX161"></A>
98Use <TT>&lsquo;<VAR>name</VAR>.po&rsquo;</TT> for output (instead of <TT>&lsquo;messages.po&rsquo;</TT>).
99
100<DT><SAMP>&lsquo;-o <VAR>file</VAR>&rsquo;</SAMP>
101<DD>
102<DT><SAMP>&lsquo;--output=<VAR>file</VAR>&rsquo;</SAMP>
103<DD>
104<A NAME="IDX162"></A>
105<A NAME="IDX163"></A>
106Write output to specified file (instead of <TT>&lsquo;<VAR>name</VAR>.po&rsquo;</TT> or
107<TT>&lsquo;messages.po&rsquo;</TT>).
108
109<DT><SAMP>&lsquo;-p <VAR>dir</VAR>&rsquo;</SAMP>
110<DD>
111<DT><SAMP>&lsquo;--output-dir=<VAR>dir</VAR>&rsquo;</SAMP>
112<DD>
113<A NAME="IDX164"></A>
114<A NAME="IDX165"></A>
115Output files will be placed in directory <VAR>dir</VAR>.
116
117</DL>
118
119<P>
120<A NAME="IDX166"></A>
121If the output <VAR>file</VAR> is <SAMP>&lsquo;-&rsquo;</SAMP> or <SAMP>&lsquo;/dev/stdout&rsquo;</SAMP>, the output
122is written to standard output.
123
124</P>
125
126
127<H3><A NAME="SEC31" HREF="gettext_toc.html#TOC31">5.1.3  Choice of input file language</A></H3>
128
129<DL COMPACT>
130
131<DT><SAMP>&lsquo;-L <VAR>name</VAR>&rsquo;</SAMP>
132<DD>
133<DT><SAMP>&lsquo;--language=<VAR>name</VAR>&rsquo;</SAMP>
134<DD>
135<A NAME="IDX167"></A>
136<A NAME="IDX168"></A>
137<A NAME="IDX169"></A>
138Specifies the language of the input files.  The supported languages
139are <CODE>C</CODE>, <CODE>C++</CODE>, <CODE>ObjectiveC</CODE>, <CODE>PO</CODE>, <CODE>Python</CODE>,
140<CODE>Lisp</CODE>, <CODE>EmacsLisp</CODE>, <CODE>librep</CODE>, <CODE>Scheme</CODE>, <CODE>Smalltalk</CODE>,
141<CODE>Java</CODE>, <CODE>JavaProperties</CODE>, <CODE>C#</CODE>, <CODE>awk</CODE>, <CODE>YCP</CODE>,
142<CODE>Tcl</CODE>, <CODE>Perl</CODE>, <CODE>PHP</CODE>, <CODE>GCC-source</CODE>, <CODE>NXStringTable</CODE>,
143<CODE>RST</CODE>, <CODE>Glade</CODE>.
144
145<DT><SAMP>&lsquo;-C&rsquo;</SAMP>
146<DD>
147<DT><SAMP>&lsquo;--c++&rsquo;</SAMP>
148<DD>
149<A NAME="IDX170"></A>
150<A NAME="IDX171"></A>
151This is a shorthand for <CODE>--language=C++</CODE>.
152
153</DL>
154
155<P>
156By default the language is guessed depending on the input file name
157extension.
158
159</P>
160
161
162<H3><A NAME="SEC32" HREF="gettext_toc.html#TOC32">5.1.4  Input file interpretation</A></H3>
163
164<DL COMPACT>
165
166<DT><SAMP>&lsquo;--from-code=<VAR>name</VAR>&rsquo;</SAMP>
167<DD>
168<A NAME="IDX172"></A>
169Specifies the encoding of the input files.  This option is needed only
170if some untranslated message strings or their corresponding comments
171contain non-ASCII characters.  Note that Tcl and Glade input files are
172always assumed to be in UTF-8, regardless of this option.
173
174</DL>
175
176<P>
177By default the input files are assumed to be in ASCII.
178
179</P>
180
181
182<H3><A NAME="SEC33" HREF="gettext_toc.html#TOC33">5.1.5  Operation mode</A></H3>
183
184<DL COMPACT>
185
186<DT><SAMP>&lsquo;-j&rsquo;</SAMP>
187<DD>
188<DT><SAMP>&lsquo;--join-existing&rsquo;</SAMP>
189<DD>
190<A NAME="IDX173"></A>
191<A NAME="IDX174"></A>
192Join messages with existing file.
193
194<DT><SAMP>&lsquo;-x <VAR>file</VAR>&rsquo;</SAMP>
195<DD>
196<DT><SAMP>&lsquo;--exclude-file=<VAR>file</VAR>&rsquo;</SAMP>
197<DD>
198<A NAME="IDX175"></A>
199<A NAME="IDX176"></A>
200Entries from <VAR>file</VAR> are not extracted.  <VAR>file</VAR> should be a PO or
201POT file.
202
203<DT><SAMP>&lsquo;-c [<VAR>tag</VAR>]&rsquo;</SAMP>
204<DD>
205<DT><SAMP>&lsquo;--add-comments[=<VAR>tag</VAR>]&rsquo;</SAMP>
206<DD>
207<A NAME="IDX177"></A>
208<A NAME="IDX178"></A>
209Place comment block with <VAR>tag</VAR> (or those preceding keyword lines)
210in output file.
211
212</DL>
213
214
215
216<H3><A NAME="SEC34" HREF="gettext_toc.html#TOC34">5.1.6  Language specific options</A></H3>
217
218<DL COMPACT>
219
220<DT><SAMP>&lsquo;-a&rsquo;</SAMP>
221<DD>
222<DT><SAMP>&lsquo;--extract-all&rsquo;</SAMP>
223<DD>
224<A NAME="IDX179"></A>
225<A NAME="IDX180"></A>
226Extract all strings.
227
228This option has an effect with most languages, namely C, C++, ObjectiveC,
229Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, Tcl, Perl, PHP,
230GCC-source, Glade.
231
232<DT><SAMP>&lsquo;-k <VAR>keywordspec</VAR>&rsquo;</SAMP>
233<DD>
234<DT><SAMP>&lsquo;--keyword[=<VAR>keywordspec</VAR>]&rsquo;</SAMP>
235<DD>
236<A NAME="IDX181"></A>
237<A NAME="IDX182"></A>
238Additional keyword to be looked for (without <VAR>keywordspec</VAR> means not to
239use default keywords).
240
241<A NAME="IDX183"></A>
242<A NAME="IDX184"></A>
243If <VAR>keywordspec</VAR> is a C identifier <VAR>id</VAR>, <CODE>xgettext</CODE> looks
244for strings in the first argument of each call to the function or macro
245<VAR>id</VAR>.  If <VAR>keywordspec</VAR> is of the form
246<SAMP>&lsquo;<VAR>id</VAR>:<VAR>argnum</VAR>&rsquo;</SAMP>, <CODE>xgettext</CODE> looks for strings in the
247<VAR>argnum</VAR>th argument of the call.  If <VAR>keywordspec</VAR> is of the form
248<SAMP>&lsquo;<VAR>id</VAR>:<VAR>argnum1</VAR>,<VAR>argnum2</VAR>&rsquo;</SAMP>, <CODE>xgettext</CODE> looks for
249strings in the <VAR>argnum1</VAR>st argument and in the <VAR>argnum2</VAR>nd argument
250of the call, and treats them as singular/plural variants for a message
251with plural handling.  Also, if <VAR>keywordspec</VAR> is of the form
252<SAMP>&lsquo;<VAR>id</VAR>:<VAR>contextargnum</VAR>c,<VAR>argnum</VAR>&rsquo;</SAMP> or
253<SAMP>&lsquo;<VAR>id</VAR>:<VAR>argnum</VAR>,<VAR>contextargnum</VAR>c&rsquo;</SAMP>, <CODE>xgettext</CODE> treats
254strings in the <VAR>contextargnum</VAR>th argument as a context specifier.
255And, as a special-purpose support for GNOME, if <VAR>keywordspec</VAR> is of the
256form <SAMP>&lsquo;<VAR>id</VAR>:<VAR>argnum</VAR>g&rsquo;</SAMP>, <CODE>xgettext</CODE> recognizes the
257<VAR>argnum</VAR>th argument as a string with context, using the GNOME <CODE>glib</CODE>
258syntax <SAMP>&lsquo;"msgctxt|msgid"&rsquo;</SAMP>.
259<BR>
260Furthermore, if <VAR>keywordspec</VAR> is of the form
261<SAMP>&lsquo;<VAR>id</VAR>:...,<VAR>totalnumargs</VAR>t&rsquo;</SAMP>, <CODE>xgettext</CODE> recognizes this
262argument specification only if the number of actual arguments is equal to
263<VAR>totalnumargs</VAR>.  This is useful for disambiguating overloaded function
264calls in C++.
265<BR>
266Finally, if <VAR>keywordspec</VAR> is of the form
267<SAMP>&lsquo;<VAR>id</VAR>:<VAR>argnum</VAR>...,"<VAR>xcomment</VAR>"&rsquo;</SAMP>, <CODE>xgettext</CODE>, when
268extracting a message from the specified argument strings, adds an extracted
269comment <VAR>xcomment</VAR> to the message.  Note that when used through a normal
270shell command line, the double-quotes around the <VAR>xcomment</VAR> need to be
271escaped.
272
273This option has an effect with most languages, namely C, C++, ObjectiveC,
274Shell, Python, Lisp, EmacsLisp, librep, Java, C#, awk, Tcl, Perl, PHP,
275GCC-source, Glade.
276
277The default keyword specifications, which are always looked for if not
278explicitly disabled, are language dependent.  They are:
279
280
281<UL>
282<LI>
283
284For C, C++, and GCC-source: <CODE>gettext</CODE>, <CODE>dgettext:2</CODE>,
285<CODE>dcgettext:2</CODE>, <CODE>ngettext:1,2</CODE>, <CODE>dngettext:2,3</CODE>,
286<CODE>dcngettext:2,3</CODE>, <CODE>gettext_noop</CODE>, and <CODE>pgettext:1c,2</CODE>,
287<CODE>dpgettext:2c,3</CODE>, <CODE>dcpgettext:2c,3</CODE>, <CODE>npgettext:1c,2,3</CODE>,
288<CODE>dnpgettext:2c,3,4</CODE>, <CODE>dcnpgettext:2c,3,4</CODE>.
289
290<LI>
291
292For Objective C: Like for C, and also <CODE>NSLocalizedString</CODE>, <CODE>_</CODE>,
293<CODE>NSLocalizedStaticString</CODE>, <CODE>__</CODE>.
294
295<LI>
296
297For Shell scripts: <CODE>gettext</CODE>, <CODE>ngettext:1,2</CODE>, <CODE>eval_gettext</CODE>,
298<CODE>eval_ngettext:1,2</CODE>.
299
300<LI>
301
302For Python: <CODE>gettext</CODE>, <CODE>ugettext</CODE>, <CODE>dgettext:2</CODE>,
303<CODE>ngettext:1,2</CODE>, <CODE>ungettext:1,2</CODE>, <CODE>dngettext:2,3</CODE>, <CODE>_</CODE>.
304
305<LI>
306
307For Lisp: <CODE>gettext</CODE>, <CODE>ngettext:1,2</CODE>, <CODE>gettext-noop</CODE>.
308
309<LI>
310
311For EmacsLisp: <CODE>_</CODE>.
312
313<LI>
314
315For librep: <CODE>_</CODE>.
316
317<LI>
318
319For Scheme: <CODE>gettext</CODE>, <CODE>ngettext:1,2</CODE>, <CODE>gettext-noop</CODE>.
320
321<LI>
322
323For Java: <CODE>GettextResource.gettext:2</CODE>,
324<CODE>GettextResource.ngettext:2,3</CODE>, <CODE>GettextResource.pgettext:2c,3</CODE>,
325<CODE>GettextResource.npgettext:2c,3,4</CODE>, <CODE>gettext</CODE>, <CODE>ngettext:1,2</CODE>,
326<CODE>pgettext:1c,2</CODE>, <CODE>npgettext:1c,2,3</CODE>, <CODE>getString</CODE>.
327
328<LI>
329
330For C#: <CODE>GetString</CODE>, <CODE>GetPluralString:1,2</CODE>,
331<CODE>GetParticularString:1c,2</CODE>, <CODE>GetParticularPluralString:1c,2,3</CODE>.
332
333<LI>
334
335For awk: <CODE>dcgettext</CODE>, <CODE>dcngettext:1,2</CODE>.
336
337<LI>
338
339For Tcl: <CODE>::msgcat::mc</CODE>.
340
341<LI>
342
343For Perl: <CODE>gettext</CODE>, <CODE>%gettext</CODE>, <CODE>$gettext</CODE>, <CODE>dgettext:2</CODE>,
344<CODE>dcgettext:2</CODE>, <CODE>ngettext:1,2</CODE>, <CODE>dngettext:2,3</CODE>,
345<CODE>dcngettext:2,3</CODE>, <CODE>gettext_noop</CODE>.
346
347<LI>
348
349For PHP: <CODE>_</CODE>, <CODE>gettext</CODE>, <CODE>dgettext:2</CODE>, <CODE>dcgettext:2</CODE>,
350<CODE>ngettext:1,2</CODE>, <CODE>dngettext:2,3</CODE>, <CODE>dcngettext:2,3</CODE>.
351
352<LI>
353
354For Glade 1: <CODE>label</CODE>, <CODE>title</CODE>, <CODE>text</CODE>, <CODE>format</CODE>,
355<CODE>copyright</CODE>, <CODE>comments</CODE>, <CODE>preview_text</CODE>, <CODE>tooltip</CODE>.
356</UL>
357
358To disable the default keyword specifications, the option <SAMP>&lsquo;-k&rsquo;</SAMP> or
359<SAMP>&lsquo;--keyword&rsquo;</SAMP> or <SAMP>&lsquo;--keyword=&rsquo;</SAMP>, without a <VAR>keywordspec</VAR>, can be
360used.
361
362<DT><SAMP>&lsquo;--flag=<VAR>word</VAR>:<VAR>arg</VAR>:<VAR>flag</VAR>&rsquo;</SAMP>
363<DD>
364<A NAME="IDX185"></A>
365Specifies additional flags for strings occurring as part of the <VAR>arg</VAR>th
366argument of the function <VAR>word</VAR>.  The possible flags are the possible
367format string indicators, such as <SAMP>&lsquo;c-format&rsquo;</SAMP>, and their negations,
368such as <SAMP>&lsquo;no-c-format&rsquo;</SAMP>, possibly prefixed with <SAMP>&lsquo;pass-&rsquo;</SAMP>.
369<BR>
370<A NAME="IDX186"></A>
371The meaning of <CODE>--flag=<VAR>function</VAR>:<VAR>arg</VAR>:<VAR>lang</VAR>-format</CODE>
372is that in language <VAR>lang</VAR>, the specified <VAR>function</VAR> expects as
373<VAR>arg</VAR>th argument a format string.  (For those of you familiar with
374GCC function attributes, <CODE>--flag=<VAR>function</VAR>:<VAR>arg</VAR>:c-format</CODE> is
375roughly equivalent to the declaration
376<SAMP>&lsquo;__attribute__ ((__format__ (__printf__, <VAR>arg</VAR>, ...)))&rsquo;</SAMP> attached
377to <VAR>function</VAR> in a C source file.)
378For example, if you use the <SAMP>&lsquo;error&rsquo;</SAMP> function from GNU libc, you can
379specify its behaviour through <CODE>--flag=error:3:c-format</CODE>.  The effect of
380this specification is that <CODE>xgettext</CODE> will mark as format strings all
381<CODE>gettext</CODE> invocations that occur as <VAR>arg</VAR>th argument of
382<VAR>function</VAR>.
383This is useful when such strings contain no format string directives:
384together with the checks done by <SAMP>&lsquo;msgfmt -c&rsquo;</SAMP> it will ensure that
385translators cannot accidentally use format string directives that would
386lead to a crash at runtime.
387<BR>
388<A NAME="IDX187"></A>
389The meaning of <CODE>--flag=<VAR>function</VAR>:<VAR>arg</VAR>:pass-<VAR>lang</VAR>-format</CODE>
390is that in language <VAR>lang</VAR>, if the <VAR>function</VAR> call occurs in a
391position that must yield a format string, then its <VAR>arg</VAR>th argument
392must yield a format string of the same type as well.  (If you know GCC
393function attributes, the <CODE>--flag=<VAR>function</VAR>:<VAR>arg</VAR>:pass-c-format</CODE>
394option is roughly equivalent to the declaration
395<SAMP>&lsquo;__attribute__ ((__format_arg__ (<VAR>arg</VAR>)))&rsquo;</SAMP> attached to <VAR>function</VAR>
396in a C source file.)
397For example, if you use the <SAMP>&lsquo;_&rsquo;</SAMP> shortcut for the <CODE>gettext</CODE> function,
398you should use <CODE>--flag=_:1:pass-c-format</CODE>.  The effect of this
399specification is that <CODE>xgettext</CODE> will propagate a format string
400requirement for a <CODE>_("string")</CODE> call to its first argument, the literal
401<CODE>"string"</CODE>, and thus mark it as a format string.
402This is useful when such strings contain no format string directives:
403together with the checks done by <SAMP>&lsquo;msgfmt -c&rsquo;</SAMP> it will ensure that
404translators cannot accidentally use format string directives that would
405lead to a crash at runtime.
406<BR>
407This option has an effect with most languages, namely C, C++, ObjectiveC,
408Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, YCP, Tcl, Perl, PHP,
409GCC-source.
410
411<DT><SAMP>&lsquo;-T&rsquo;</SAMP>
412<DD>
413<DT><SAMP>&lsquo;--trigraphs&rsquo;</SAMP>
414<DD>
415<A NAME="IDX188"></A>
416<A NAME="IDX189"></A>
417<A NAME="IDX190"></A>
418Understand ANSI C trigraphs for input.
419<BR>
420This option has an effect only with the languages C, C++, ObjectiveC.
421
422<DT><SAMP>&lsquo;--qt&rsquo;</SAMP>
423<DD>
424<A NAME="IDX191"></A>
425<A NAME="IDX192"></A>
426Recognize Qt format strings.
427<BR>
428This option has an effect only with the language C++.
429
430<DT><SAMP>&lsquo;--kde&rsquo;</SAMP>
431<DD>
432<A NAME="IDX193"></A>
433<A NAME="IDX194"></A>
434Recognize KDE 4 format strings.
435<BR>
436This option has an effect only with the language C++.
437
438<DT><SAMP>&lsquo;--boost&rsquo;</SAMP>
439<DD>
440<A NAME="IDX195"></A>
441<A NAME="IDX196"></A>
442Recognize Boost format strings.
443<BR>
444This option has an effect only with the language C++.
445
446<DT><SAMP>&lsquo;--debug&rsquo;</SAMP>
447<DD>
448<A NAME="IDX197"></A>
449<A NAME="IDX198"></A>
450Use the flags <CODE>c-format</CODE> and <CODE>possible-c-format</CODE> to show who was
451responsible for marking a message as a format string.  The latter form is
452used if the <CODE>xgettext</CODE> program decided, the format form is used if
453the programmer prescribed it.
454
455By default only the <CODE>c-format</CODE> form is used.  The translator should
456not have to care about these details.
457
458</DL>
459
460<P>
461This implementation of <CODE>xgettext</CODE> is able to process a few awkward
462cases, like strings in preprocessor macros, ANSI concatenation of
463adjacent strings, and escaped end of lines for continued strings.
464
465</P>
466
467
468<H3><A NAME="SEC35" HREF="gettext_toc.html#TOC35">5.1.7  Output details</A></H3>
469
470<DL COMPACT>
471
472<DT><SAMP>&lsquo;--force-po&rsquo;</SAMP>
473<DD>
474<A NAME="IDX199"></A>
475Always write an output file even if no message is defined.
476
477<DT><SAMP>&lsquo;-i&rsquo;</SAMP>
478<DD>
479<DT><SAMP>&lsquo;--indent&rsquo;</SAMP>
480<DD>
481<A NAME="IDX200"></A>
482<A NAME="IDX201"></A>
483Write the .po file using indented style.
484
485<DT><SAMP>&lsquo;--no-location&rsquo;</SAMP>
486<DD>
487<A NAME="IDX202"></A>
488Do not write <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines.  Note that using
489this option makes it harder for technically skilled translators to understand
490each message's context.
491
492<DT><SAMP>&lsquo;-n&rsquo;</SAMP>
493<DD>
494<DT><SAMP>&lsquo;--add-location&rsquo;</SAMP>
495<DD>
496<A NAME="IDX203"></A>
497<A NAME="IDX204"></A>
498Generate <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines (default).
499
500<DT><SAMP>&lsquo;--strict&rsquo;</SAMP>
501<DD>
502<A NAME="IDX205"></A>
503Write out a strict Uniforum conforming PO file.  Note that this
504Uniforum format should be avoided because it doesn't support the
505GNU extensions.
506
507<DT><SAMP>&lsquo;--properties-output&rsquo;</SAMP>
508<DD>
509<A NAME="IDX206"></A>
510Write out a Java ResourceBundle in Java <CODE>.properties</CODE> syntax.  Note
511that this file format doesn't support plural forms and silently drops
512obsolete messages.
513
514<DT><SAMP>&lsquo;--stringtable-output&rsquo;</SAMP>
515<DD>
516<A NAME="IDX207"></A>
517Write out a NeXTstep/GNUstep localized resource file in <CODE>.strings</CODE> syntax.
518Note that this file format doesn't support plural forms.
519
520<DT><SAMP>&lsquo;-w <VAR>number</VAR>&rsquo;</SAMP>
521<DD>
522<DT><SAMP>&lsquo;--width=<VAR>number</VAR>&rsquo;</SAMP>
523<DD>
524<A NAME="IDX208"></A>
525<A NAME="IDX209"></A>
526Set the output page width.  Long strings in the output files will be
527split across multiple lines in order to ensure that each line's width
528(= number of screen columns) is less or equal to the given <VAR>number</VAR>.
529
530<DT><SAMP>&lsquo;--no-wrap&rsquo;</SAMP>
531<DD>
532<A NAME="IDX210"></A>
533Do not break long message lines.  Message lines whose width exceeds the
534output page width will not be split into several lines.  Only file reference
535lines which are wider than the output page width will be split.
536
537<DT><SAMP>&lsquo;-s&rsquo;</SAMP>
538<DD>
539<DT><SAMP>&lsquo;--sort-output&rsquo;</SAMP>
540<DD>
541<A NAME="IDX211"></A>
542<A NAME="IDX212"></A>
543<A NAME="IDX213"></A>
544Generate sorted output.  Note that using this option makes it much harder
545for the translator to understand each message's context.
546
547<DT><SAMP>&lsquo;-F&rsquo;</SAMP>
548<DD>
549<DT><SAMP>&lsquo;--sort-by-file&rsquo;</SAMP>
550<DD>
551<A NAME="IDX214"></A>
552<A NAME="IDX215"></A>
553Sort output by file location.
554
555<DT><SAMP>&lsquo;--omit-header&rsquo;</SAMP>
556<DD>
557<A NAME="IDX216"></A>
558Don't write header with <SAMP>&lsquo;msgid ""&rsquo;</SAMP> entry.
559
560<A NAME="IDX217"></A>
561This is useful for testing purposes because it eliminates a source
562of variance for generated <CODE>.gmo</CODE> files.  With <CODE>--omit-header</CODE>,
563two invocations of <CODE>xgettext</CODE> on the same files with the same
564options at different times are guaranteed to produce the same results.
565
566Note that using this option will lead to an error if the resulting file
567would not entirely be in ASCII.
568
569<DT><SAMP>&lsquo;--copyright-holder=<VAR>string</VAR>&rsquo;</SAMP>
570<DD>
571<A NAME="IDX218"></A>
572Set the copyright holder in the output.  <VAR>string</VAR> should be the
573copyright holder of the surrounding package.  (Note that the msgstr
574strings, extracted from the package's sources, belong to the copyright
575holder of the package.)  Translators are expected to transfer or disclaim
576the copyright for their translations, so that package maintainers can
577distribute them without legal risk.  If <VAR>string</VAR> is empty, the output
578files are marked as being in the public domain; in this case, the translators
579are expected to disclaim their copyright, again so that package maintainers
580can distribute them without legal risk.
581
582The default value for <VAR>string</VAR> is the Free Software Foundation, Inc.,
583simply because <CODE>xgettext</CODE> was first used in the GNU project.
584
585<DT><SAMP>&lsquo;--foreign-user&rsquo;</SAMP>
586<DD>
587<A NAME="IDX219"></A>
588Omit FSF copyright in output.  This option is equivalent to
589<SAMP>&lsquo;--copyright-holder=���&rsquo;</SAMP>.  It can be useful for packages outside the GNU
590project that want their translations to be in the public domain.
591
592<DT><SAMP>&lsquo;--package-name=<VAR>package</VAR>&rsquo;</SAMP>
593<DD>
594<A NAME="IDX220"></A>
595Set the package name in the header of the output.
596
597<DT><SAMP>&lsquo;--package-version=<VAR>version</VAR>&rsquo;</SAMP>
598<DD>
599<A NAME="IDX221"></A>
600Set the package version in the header of the output.  This option has an
601effect only if the <SAMP>&lsquo;--package-name&rsquo;</SAMP> option is also used.
602
603<DT><SAMP>&lsquo;--msgid-bugs-address=<VAR>email@address</VAR>&rsquo;</SAMP>
604<DD>
605<A NAME="IDX222"></A>
606Set the reporting address for msgid bugs.  This is the email address or URL
607to which the translators shall report bugs in the untranslated strings:
608
609
610<UL>
611<LI>Strings which are not entire sentences, see the maintainer guidelines
612
613in section <A HREF="gettext_4.html#SEC19">4.3  Preparing Translatable Strings</A>.
614<LI>Strings which use unclear terms or require additional context to be
615
616understood.
617<LI>Strings which make invalid assumptions about notation of date, time or
618
619money.
620<LI>Pluralisation problems.
621
622<LI>Incorrect English spelling.
623
624<LI>Incorrect formatting.
625
626</UL>
627
628It can be your email address, or a mailing list address where translators
629can write to without being subscribed, or the URL of a web page through
630which the translators can contact you.
631
632The default value is empty, which means that translators will be clueless!
633Don't forget to specify this option.
634
635<DT><SAMP>&lsquo;-m [<VAR>string</VAR>]&rsquo;</SAMP>
636<DD>
637<DT><SAMP>&lsquo;--msgstr-prefix[=<VAR>string</VAR>]&rsquo;</SAMP>
638<DD>
639<A NAME="IDX223"></A>
640<A NAME="IDX224"></A>
641Use <VAR>string</VAR> (or "" if not specified) as prefix for msgstr entries.
642
643<DT><SAMP>&lsquo;-M [<VAR>string</VAR>]&rsquo;</SAMP>
644<DD>
645<DT><SAMP>&lsquo;--msgstr-suffix[=<VAR>string</VAR>]&rsquo;</SAMP>
646<DD>
647<A NAME="IDX225"></A>
648<A NAME="IDX226"></A>
649Use <VAR>string</VAR> (or "" if not specified) as suffix for msgstr entries.
650
651</DL>
652
653
654
655<H3><A NAME="SEC36" HREF="gettext_toc.html#TOC36">5.1.8  Informative output</A></H3>
656
657<DL COMPACT>
658
659<DT><SAMP>&lsquo;-h&rsquo;</SAMP>
660<DD>
661<DT><SAMP>&lsquo;--help&rsquo;</SAMP>
662<DD>
663<A NAME="IDX227"></A>
664<A NAME="IDX228"></A>
665Display this help and exit.
666
667<DT><SAMP>&lsquo;-V&rsquo;</SAMP>
668<DD>
669<DT><SAMP>&lsquo;--version&rsquo;</SAMP>
670<DD>
671<A NAME="IDX229"></A>
672<A NAME="IDX230"></A>
673Output version information and exit.
674
675</DL>
676
677<P><HR><P>
678Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_4.html">previous</A>, <A HREF="gettext_6.html">next</A>, <A HREF="gettext_25.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
679</BODY>
680</HTML>
681