Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / doc / gettext_7.html
1 <HTML>
2 <HEAD>
3 <!-- This HTML file has been created by texi2html 1.52b
4      from gettext.texi on 28 December 2015 -->
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>
10 Go 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="SEC45" HREF="gettext_toc.html#TOC45">7  Updating Existing PO Files</A></H1>
15
16
17
18 <H2><A NAME="SEC46" HREF="gettext_toc.html#TOC46">7.1  Invoking the <CODE>msgmerge</CODE> Program</A></H2>
19
20 <P>
21 <A NAME="IDX288"></A>
22 <A NAME="IDX289"></A>
23
24 <PRE>
25 msgmerge [<VAR>option</VAR>] <VAR>def</VAR>.po <VAR>ref</VAR>.pot
26 </PRE>
27
28 <P>
29 The <CODE>msgmerge</CODE> program merges two Uniforum style .po files together.
30 The <VAR>def</VAR>.po file is an existing PO file with translations which will
31 be taken over to the newly created file as long as they still match;
32 comments will be preserved, but extracted comments and file positions will
33 be discarded.  The <VAR>ref</VAR>.pot file is the last created PO file with
34 up-to-date source references but old translations, or a PO Template file
35 (generally created by <CODE>xgettext</CODE>); any translations or comments
36 in the file will be discarded, however dot comments and file positions
37 will be preserved.  Where an exact match cannot be found, fuzzy matching
38 is used to produce better results.
39
40 </P>
41
42
43 <H3><A NAME="SEC47" HREF="gettext_toc.html#TOC47">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>
49 Translations referring to old sources.
50
51 <DT><SAMP>&lsquo;<VAR>ref</VAR>.pot&rsquo;</SAMP>
52 <DD>
53 References 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="IDX290"></A>
60 <A NAME="IDX291"></A>
61 Add <VAR>directory</VAR> to the list of directories.  Source files are
62 searched relative to this list of directories.  The resulting <TT>&lsquo;.po&rsquo;</TT>
63 file 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="IDX292"></A>
70 <A NAME="IDX293"></A>
71 Specify an additional library of message translations.  See section <A HREF="gettext_8.html#SEC72">8.4  Using Translation Compendia</A>.
72 This option may be specified more than once.
73
74 </DL>
75
76
77
78 <H3><A NAME="SEC48" HREF="gettext_toc.html#TOC48">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="IDX294"></A>
87 <A NAME="IDX295"></A>
88 Update <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="SEC49" HREF="gettext_toc.html#TOC49">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="IDX296"></A>
103 <A NAME="IDX297"></A>
104 Write output to specified file.
105
106 </DL>
107
108 <P>
109 <A NAME="IDX298"></A>
110 The results are written to standard output if no output file is specified
111 or if it is <SAMP>&lsquo;-&rsquo;</SAMP>.
112
113 </P>
114
115
116 <H3><A NAME="SEC50" HREF="gettext_toc.html#TOC50">7.1.4  Output file location in update mode</A></H3>
117
118 <P>
119 The 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="IDX299"></A>
127 <A NAME="IDX300"></A>
128 Make a backup of <VAR>def</VAR>.po
129
130 <DT><SAMP>&lsquo;--suffix=<VAR>suffix</VAR>&rsquo;</SAMP>
131 <DD>
132 <A NAME="IDX301"></A>
133 Override the usual backup suffix.
134
135 </DL>
136
137 <P>
138 <A NAME="IDX302"></A>
139 The version control method may be selected via the <CODE>--backup</CODE> option
140 or through the <CODE>VERSION_CONTROL</CODE> environment variable.  Here are the
141 values:
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>
150 Never 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>
156 Make numbered backups.
157
158 <DT><SAMP>&lsquo;existing&rsquo;</SAMP>
159 <DD>
160 <DT><SAMP>&lsquo;nil&rsquo;</SAMP>
161 <DD>
162 Make numbered backups if numbered backups for this file already exist,
163 otherwise make simple backups.
164
165 <DT><SAMP>&lsquo;simple&rsquo;</SAMP>
166 <DD>
167 <DT><SAMP>&lsquo;never&rsquo;</SAMP>
168 <DD>
169 Always make simple backups.
170
171 </DL>
172
173 <P>
174 The 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="SEC51" HREF="gettext_toc.html#TOC51">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="IDX303"></A>
189 <A NAME="IDX304"></A>
190 Apply <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="IDX305"></A>
197 <A NAME="IDX306"></A>
198 Do not use fuzzy matching when an exact match is not found.  This may speed
199 up the operation considerably.
200
201 <DT><SAMP>&lsquo;--previous&rsquo;</SAMP>
202 <DD>
203 <A NAME="IDX307"></A>
204 Keep the previous msgids of translated messages, marked with <SAMP>&lsquo;#|&rsquo;</SAMP>, when
205 adding the fuzzy marker to such messages.
206 </DL>
207
208
209
210 <H3><A NAME="SEC52" HREF="gettext_toc.html#TOC52">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="IDX308"></A>
219 <A NAME="IDX309"></A>
220 Assume the input files are Java ResourceBundles in Java <CODE>.properties</CODE>
221 syntax, not in PO file syntax.
222
223 <DT><SAMP>&lsquo;--stringtable-input&rsquo;</SAMP>
224 <DD>
225 <A NAME="IDX310"></A>
226 Assume 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="SEC53" HREF="gettext_toc.html#TOC53">7.1.7  Output details</A></H3>
234
235 <DL COMPACT>
236
237 <DT><SAMP>&lsquo;--lang=<VAR>catalogname</VAR>&rsquo;</SAMP>
238 <DD>
239 <A NAME="IDX311"></A>
240 Specify the <SAMP>&lsquo;Language&rsquo;</SAMP> field to be used in the header entry.  See
241 section <A HREF="gettext_6.html#SEC44">6.2  Filling in the Header Entry</A> for the meaning of this field.  Note: The
242 <SAMP>&lsquo;Language-Team&rsquo;</SAMP> and <SAMP>&lsquo;Plural-Forms&rsquo;</SAMP> fields are left unchanged.
243 If this option is not specified, the <SAMP>&lsquo;Language&rsquo;</SAMP> field is inferred, as
244 best as possible, from the <SAMP>&lsquo;Language-Team&rsquo;</SAMP> field.
245
246 <DT><SAMP>&lsquo;--color&rsquo;</SAMP>
247 <DD>
248 <DT><SAMP>&lsquo;--color=<VAR>when</VAR>&rsquo;</SAMP>
249 <DD>
250 <A NAME="IDX312"></A>
251 Specify whether or when to use colors and other text attributes.
252 See section <A HREF="gettext_9.html#SEC150">9.11.1  The <CODE>--color</CODE> option</A> for details.
253
254 <DT><SAMP>&lsquo;--style=<VAR>style_file</VAR>&rsquo;</SAMP>
255 <DD>
256 <A NAME="IDX313"></A>
257 Specify the CSS style rule file to use for <CODE>--color</CODE>.
258 See section <A HREF="gettext_9.html#SEC152">9.11.3  The <CODE>--style</CODE> option</A> for details.
259
260 <DT><SAMP>&lsquo;--force-po&rsquo;</SAMP>
261 <DD>
262 <A NAME="IDX314"></A>
263 Always write an output file even if it contains no message.
264
265 <DT><SAMP>&lsquo;-i&rsquo;</SAMP>
266 <DD>
267 <DT><SAMP>&lsquo;--indent&rsquo;</SAMP>
268 <DD>
269 <A NAME="IDX315"></A>
270 <A NAME="IDX316"></A>
271 Write the .po file using indented style.
272
273 <DT><SAMP>&lsquo;--no-location&rsquo;</SAMP>
274 <DD>
275 <A NAME="IDX317"></A>
276 Do not write <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines.
277
278 <DT><SAMP>&lsquo;-n&rsquo;</SAMP>
279 <DD>
280 <DT><SAMP>&lsquo;--add-location=<VAR>type</VAR>&rsquo;</SAMP>
281 <DD>
282 <A NAME="IDX318"></A>
283 Generate <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines (default).
284
285 The optional <VAR>type</VAR> can be either <SAMP>&lsquo;full&rsquo;</SAMP>, <SAMP>&lsquo;file&rsquo;</SAMP>, or
286 <SAMP>&lsquo;never&rsquo;</SAMP>.  If it is not given or <SAMP>&lsquo;full&rsquo;</SAMP>, it generates the
287 lines with both file name and line number.  If it is <SAMP>&lsquo;file&rsquo;</SAMP>, the
288 line number part is omitted.  If it is <SAMP>&lsquo;never&rsquo;</SAMP>, it completely
289 suppresses the lines (same as <CODE>--no-location</CODE>).
290
291 <DT><SAMP>&lsquo;--strict&rsquo;</SAMP>
292 <DD>
293 <A NAME="IDX319"></A>
294 Write out a strict Uniforum conforming PO file.  Note that this
295 Uniforum format should be avoided because it doesn't support the
296 GNU extensions.
297
298 <DT><SAMP>&lsquo;-p&rsquo;</SAMP>
299 <DD>
300 <DT><SAMP>&lsquo;--properties-output&rsquo;</SAMP>
301 <DD>
302 <A NAME="IDX320"></A>
303 <A NAME="IDX321"></A>
304 Write out a Java ResourceBundle in Java <CODE>.properties</CODE> syntax.  Note
305 that this file format doesn't support plural forms and silently drops
306 obsolete messages.
307
308 <DT><SAMP>&lsquo;--stringtable-output&rsquo;</SAMP>
309 <DD>
310 <A NAME="IDX322"></A>
311 Write out a NeXTstep/GNUstep localized resource file in <CODE>.strings</CODE> syntax.
312 Note that this file format doesn't support plural forms.
313
314 <DT><SAMP>&lsquo;-w <VAR>number</VAR>&rsquo;</SAMP>
315 <DD>
316 <DT><SAMP>&lsquo;--width=<VAR>number</VAR>&rsquo;</SAMP>
317 <DD>
318 <A NAME="IDX323"></A>
319 <A NAME="IDX324"></A>
320 Set the output page width.  Long strings in the output files will be
321 split across multiple lines in order to ensure that each line's width
322 (= number of screen columns) is less or equal to the given <VAR>number</VAR>.
323
324 <DT><SAMP>&lsquo;--no-wrap&rsquo;</SAMP>
325 <DD>
326 <A NAME="IDX325"></A>
327 Do not break long message lines.  Message lines whose width exceeds the
328 output page width will not be split into several lines.  Only file reference
329 lines which are wider than the output page width will be split.
330
331 <DT><SAMP>&lsquo;-s&rsquo;</SAMP>
332 <DD>
333 <DT><SAMP>&lsquo;--sort-output&rsquo;</SAMP>
334 <DD>
335 <A NAME="IDX326"></A>
336 <A NAME="IDX327"></A>
337 <A NAME="IDX328"></A>
338 Generate sorted output.  Note that using this option makes it much harder
339 for the translator to understand each message's context.
340
341 <DT><SAMP>&lsquo;-F&rsquo;</SAMP>
342 <DD>
343 <DT><SAMP>&lsquo;--sort-by-file&rsquo;</SAMP>
344 <DD>
345 <A NAME="IDX329"></A>
346 <A NAME="IDX330"></A>
347 Sort output by file location.
348
349 </DL>
350
351
352
353 <H3><A NAME="SEC54" HREF="gettext_toc.html#TOC54">7.1.8  Informative output</A></H3>
354
355 <DL COMPACT>
356
357 <DT><SAMP>&lsquo;-h&rsquo;</SAMP>
358 <DD>
359 <DT><SAMP>&lsquo;--help&rsquo;</SAMP>
360 <DD>
361 <A NAME="IDX331"></A>
362 <A NAME="IDX332"></A>
363 Display this help and exit.
364
365 <DT><SAMP>&lsquo;-V&rsquo;</SAMP>
366 <DD>
367 <DT><SAMP>&lsquo;--version&rsquo;</SAMP>
368 <DD>
369 <A NAME="IDX333"></A>
370 <A NAME="IDX334"></A>
371 Output version information and exit.
372
373 <DT><SAMP>&lsquo;-v&rsquo;</SAMP>
374 <DD>
375 <DT><SAMP>&lsquo;--verbose&rsquo;</SAMP>
376 <DD>
377 <A NAME="IDX335"></A>
378 <A NAME="IDX336"></A>
379 Increase verbosity level.
380
381 <DT><SAMP>&lsquo;-q&rsquo;</SAMP>
382 <DD>
383 <DT><SAMP>&lsquo;--quiet&rsquo;</SAMP>
384 <DD>
385 <DT><SAMP>&lsquo;--silent&rsquo;</SAMP>
386 <DD>
387 <A NAME="IDX337"></A>
388 <A NAME="IDX338"></A>
389 <A NAME="IDX339"></A>
390 Suppress progress indicators.
391
392 </DL>
393
394 <P><HR><P>
395 Go 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>.
396 </BODY>
397 </HTML>