xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/doc/gettext_7.html (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1<HTML>
2<HEAD>
3<!-- This HTML file has been created by texi2html 1.52b
4     from gettext.texi on 27 November 2006 -->
5
6<META HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
7<TITLE>GNU gettext utilities - 7  Updating Existing PO Files</TITLE>
8</HEAD>
9<BODY>
10Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_6.html">previous</A>, <A HREF="gettext_8.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="SEC39" HREF="gettext_toc.html#TOC39">7  Updating Existing PO Files</A></H1>
15
16
17
18<H2><A NAME="SEC40" HREF="gettext_toc.html#TOC40">7.1  Invoking the <CODE>msgmerge</CODE> Program</A></H2>
19
20<P>
21<A NAME="IDX252"></A>
22<A NAME="IDX253"></A>
23
24<PRE>
25msgmerge [<VAR>option</VAR>] <VAR>def</VAR>.po <VAR>ref</VAR>.pot
26</PRE>
27
28<P>
29The <CODE>msgmerge</CODE> program merges two Uniforum style .po files together.
30The <VAR>def</VAR>.po file is an existing PO file with translations which will
31be taken over to the newly created file as long as they still match;
32comments will be preserved, but extracted comments and file positions will
33be discarded.  The <VAR>ref</VAR>.pot file is the last created PO file with
34up-to-date source references but old translations, or a PO Template file
35(generally created by <CODE>xgettext</CODE>); any translations or comments
36in the file will be discarded, however dot comments and file positions
37will be preserved.  Where an exact match cannot be found, fuzzy matching
38is used to produce better results.
39
40</P>
41
42
43<H3><A NAME="SEC41" HREF="gettext_toc.html#TOC41">7.1.1  Input file location</A></H3>
44
45<DL COMPACT>
46
47<DT><SAMP>&lsquo;<VAR>def</VAR>.po&rsquo;</SAMP>
48<DD>
49Translations referring to old sources.
50
51<DT><SAMP>&lsquo;<VAR>ref</VAR>.pot&rsquo;</SAMP>
52<DD>
53References to the new sources.
54
55<DT><SAMP>&lsquo;-D <VAR>directory</VAR>&rsquo;</SAMP>
56<DD>
57<DT><SAMP>&lsquo;--directory=<VAR>directory</VAR>&rsquo;</SAMP>
58<DD>
59<A NAME="IDX254"></A>
60<A NAME="IDX255"></A>
61Add <VAR>directory</VAR> to the list of directories.  Source files are
62searched relative to this list of directories.  The resulting <TT>&lsquo;.po&rsquo;</TT>
63file will be written relative to the current directory, though.
64
65<DT><SAMP>&lsquo;-C <VAR>file</VAR>&rsquo;</SAMP>
66<DD>
67<DT><SAMP>&lsquo;--compendium=<VAR>file</VAR>&rsquo;</SAMP>
68<DD>
69<A NAME="IDX256"></A>
70<A NAME="IDX257"></A>
71Specify an additional library of message translations.  See section <A HREF="gettext_8.html#SEC66">8.3.14  Using Translation Compendia</A>.
72This option may be specified more than once.
73
74</DL>
75
76
77
78<H3><A NAME="SEC42" HREF="gettext_toc.html#TOC42">7.1.2  Operation mode</A></H3>
79
80<DL COMPACT>
81
82<DT><SAMP>&lsquo;-U&rsquo;</SAMP>
83<DD>
84<DT><SAMP>&lsquo;--update&rsquo;</SAMP>
85<DD>
86<A NAME="IDX258"></A>
87<A NAME="IDX259"></A>
88Update <VAR>def</VAR>.po.  Do nothing if <VAR>def</VAR>.po is already up to date.
89
90</DL>
91
92
93
94<H3><A NAME="SEC43" HREF="gettext_toc.html#TOC43">7.1.3  Output file location</A></H3>
95
96<DL COMPACT>
97
98<DT><SAMP>&lsquo;-o <VAR>file</VAR>&rsquo;</SAMP>
99<DD>
100<DT><SAMP>&lsquo;--output-file=<VAR>file</VAR>&rsquo;</SAMP>
101<DD>
102<A NAME="IDX260"></A>
103<A NAME="IDX261"></A>
104Write output to specified file.
105
106</DL>
107
108<P>
109<A NAME="IDX262"></A>
110The results are written to standard output if no output file is specified
111or if it is <SAMP>&lsquo;-&rsquo;</SAMP>.
112
113</P>
114
115
116<H3><A NAME="SEC44" HREF="gettext_toc.html#TOC44">7.1.4  Output file location in update mode</A></H3>
117
118<P>
119The result is written back to <VAR>def</VAR>.po.
120
121</P>
122<DL COMPACT>
123
124<DT><SAMP>&lsquo;--backup=<VAR>control</VAR>&rsquo;</SAMP>
125<DD>
126<A NAME="IDX263"></A>
127<A NAME="IDX264"></A>
128Make a backup of <VAR>def</VAR>.po
129
130<DT><SAMP>&lsquo;--suffix=<VAR>suffix</VAR>&rsquo;</SAMP>
131<DD>
132<A NAME="IDX265"></A>
133Override the usual backup suffix.
134
135</DL>
136
137<P>
138<A NAME="IDX266"></A>
139The version control method may be selected via the <CODE>--backup</CODE> option
140or through the <CODE>VERSION_CONTROL</CODE> environment variable.  Here are the
141values:
142
143</P>
144<DL COMPACT>
145
146<DT><SAMP>&lsquo;none&rsquo;</SAMP>
147<DD>
148<DT><SAMP>&lsquo;off&rsquo;</SAMP>
149<DD>
150Never make backups (even if <CODE>--backup</CODE> is given).
151
152<DT><SAMP>&lsquo;numbered&rsquo;</SAMP>
153<DD>
154<DT><SAMP>&lsquo;t&rsquo;</SAMP>
155<DD>
156Make numbered backups.
157
158<DT><SAMP>&lsquo;existing&rsquo;</SAMP>
159<DD>
160<DT><SAMP>&lsquo;nil&rsquo;</SAMP>
161<DD>
162Make numbered backups if numbered backups for this file already exist,
163otherwise make simple backups.
164
165<DT><SAMP>&lsquo;simple&rsquo;</SAMP>
166<DD>
167<DT><SAMP>&lsquo;never&rsquo;</SAMP>
168<DD>
169Always make simple backups.
170
171</DL>
172
173<P>
174The backup suffix is <SAMP>&lsquo;~&rsquo;</SAMP>, unless set with <CODE>--suffix</CODE> or the
175<CODE>SIMPLE_BACKUP_SUFFIX</CODE> environment variable.
176
177</P>
178
179
180<H3><A NAME="SEC45" HREF="gettext_toc.html#TOC45">7.1.5  Operation modifiers</A></H3>
181
182<DL COMPACT>
183
184<DT><SAMP>&lsquo;-m&rsquo;</SAMP>
185<DD>
186<DT><SAMP>&lsquo;--multi-domain&rsquo;</SAMP>
187<DD>
188<A NAME="IDX267"></A>
189<A NAME="IDX268"></A>
190Apply <VAR>ref</VAR>.pot to each of the domains in <VAR>def</VAR>.po.
191
192<DT><SAMP>&lsquo;-N&rsquo;</SAMP>
193<DD>
194<DT><SAMP>&lsquo;--no-fuzzy-matching&rsquo;</SAMP>
195<DD>
196<A NAME="IDX269"></A>
197<A NAME="IDX270"></A>
198Do not use fuzzy matching when an exact match is not found.  This may speed
199up the operation considerably.
200
201<DT><SAMP>&lsquo;--previous&rsquo;</SAMP>
202<DD>
203<A NAME="IDX271"></A>
204Keep the previous msgids of translated messages, marked with <SAMP>&lsquo;#|&rsquo;</SAMP>, when
205adding the fuzzy marker to such messages.
206</DL>
207
208
209
210<H3><A NAME="SEC46" HREF="gettext_toc.html#TOC46">7.1.6  Input file syntax</A></H3>
211
212<DL COMPACT>
213
214<DT><SAMP>&lsquo;-P&rsquo;</SAMP>
215<DD>
216<DT><SAMP>&lsquo;--properties-input&rsquo;</SAMP>
217<DD>
218<A NAME="IDX272"></A>
219<A NAME="IDX273"></A>
220Assume the input files are Java ResourceBundles in Java <CODE>.properties</CODE>
221syntax, not in PO file syntax.
222
223<DT><SAMP>&lsquo;--stringtable-input&rsquo;</SAMP>
224<DD>
225<A NAME="IDX274"></A>
226Assume the input files are NeXTstep/GNUstep localized resource files in
227<CODE>.strings</CODE> syntax, not in PO file syntax.
228
229</DL>
230
231
232
233<H3><A NAME="SEC47" HREF="gettext_toc.html#TOC47">7.1.7  Output details</A></H3>
234
235<DL COMPACT>
236
237<DT><SAMP>&lsquo;--force-po&rsquo;</SAMP>
238<DD>
239<A NAME="IDX275"></A>
240Always write an output file even if it contains no message.
241
242<DT><SAMP>&lsquo;-i&rsquo;</SAMP>
243<DD>
244<DT><SAMP>&lsquo;--indent&rsquo;</SAMP>
245<DD>
246<A NAME="IDX276"></A>
247<A NAME="IDX277"></A>
248Write the .po file using indented style.
249
250<DT><SAMP>&lsquo;--no-location&rsquo;</SAMP>
251<DD>
252<A NAME="IDX278"></A>
253Do not write <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines.
254
255<DT><SAMP>&lsquo;--add-location&rsquo;</SAMP>
256<DD>
257<A NAME="IDX279"></A>
258Generate <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines (default).
259
260<DT><SAMP>&lsquo;--strict&rsquo;</SAMP>
261<DD>
262<A NAME="IDX280"></A>
263Write out a strict Uniforum conforming PO file.  Note that this
264Uniforum format should be avoided because it doesn't support the
265GNU extensions.
266
267<DT><SAMP>&lsquo;-p&rsquo;</SAMP>
268<DD>
269<DT><SAMP>&lsquo;--properties-output&rsquo;</SAMP>
270<DD>
271<A NAME="IDX281"></A>
272<A NAME="IDX282"></A>
273Write out a Java ResourceBundle in Java <CODE>.properties</CODE> syntax.  Note
274that this file format doesn't support plural forms and silently drops
275obsolete messages.
276
277<DT><SAMP>&lsquo;--stringtable-output&rsquo;</SAMP>
278<DD>
279<A NAME="IDX283"></A>
280Write out a NeXTstep/GNUstep localized resource file in <CODE>.strings</CODE> syntax.
281Note that this file format doesn't support plural forms.
282
283<DT><SAMP>&lsquo;-w <VAR>number</VAR>&rsquo;</SAMP>
284<DD>
285<DT><SAMP>&lsquo;--width=<VAR>number</VAR>&rsquo;</SAMP>
286<DD>
287<A NAME="IDX284"></A>
288<A NAME="IDX285"></A>
289Set the output page width.  Long strings in the output files will be
290split across multiple lines in order to ensure that each line's width
291(= number of screen columns) is less or equal to the given <VAR>number</VAR>.
292
293<DT><SAMP>&lsquo;--no-wrap&rsquo;</SAMP>
294<DD>
295<A NAME="IDX286"></A>
296Do not break long message lines.  Message lines whose width exceeds the
297output page width will not be split into several lines.  Only file reference
298lines which are wider than the output page width will be split.
299
300<DT><SAMP>&lsquo;-s&rsquo;</SAMP>
301<DD>
302<DT><SAMP>&lsquo;--sort-output&rsquo;</SAMP>
303<DD>
304<A NAME="IDX287"></A>
305<A NAME="IDX288"></A>
306<A NAME="IDX289"></A>
307Generate sorted output.  Note that using this option makes it much harder
308for the translator to understand each message's context.
309
310<DT><SAMP>&lsquo;-F&rsquo;</SAMP>
311<DD>
312<DT><SAMP>&lsquo;--sort-by-file&rsquo;</SAMP>
313<DD>
314<A NAME="IDX290"></A>
315<A NAME="IDX291"></A>
316Sort output by file location.
317
318</DL>
319
320
321
322<H3><A NAME="SEC48" HREF="gettext_toc.html#TOC48">7.1.8  Informative output</A></H3>
323
324<DL COMPACT>
325
326<DT><SAMP>&lsquo;-h&rsquo;</SAMP>
327<DD>
328<DT><SAMP>&lsquo;--help&rsquo;</SAMP>
329<DD>
330<A NAME="IDX292"></A>
331<A NAME="IDX293"></A>
332Display this help and exit.
333
334<DT><SAMP>&lsquo;-V&rsquo;</SAMP>
335<DD>
336<DT><SAMP>&lsquo;--version&rsquo;</SAMP>
337<DD>
338<A NAME="IDX294"></A>
339<A NAME="IDX295"></A>
340Output version information and exit.
341
342<DT><SAMP>&lsquo;-v&rsquo;</SAMP>
343<DD>
344<DT><SAMP>&lsquo;--verbose&rsquo;</SAMP>
345<DD>
346<A NAME="IDX296"></A>
347<A NAME="IDX297"></A>
348Increase verbosity level.
349
350<DT><SAMP>&lsquo;-q&rsquo;</SAMP>
351<DD>
352<DT><SAMP>&lsquo;--quiet&rsquo;</SAMP>
353<DD>
354<DT><SAMP>&lsquo;--silent&rsquo;</SAMP>
355<DD>
356<A NAME="IDX298"></A>
357<A NAME="IDX299"></A>
358<A NAME="IDX300"></A>
359Suppress progress indicators.
360
361</DL>
362
363<P><HR><P>
364Go to the <A HREF="gettext_1.html">first</A>, <A HREF="gettext_6.html">previous</A>, <A HREF="gettext_8.html">next</A>, <A HREF="gettext_25.html">last</A> section, <A HREF="gettext_toc.html">table of contents</A>.
365</BODY>
366</HTML>
367