Install gettext-0.18.1.1.tar.gz
[msysgit.git] / mingw / share / doc / gettext / gettext_7.html
blobf7344ed6ac1987a2eb704b0562d8638abf0943e9
1 <HTML>
2 <HEAD>
3 <!-- This HTML file has been created by texi2html 1.52b
4 from gettext.texi on 6 June 2010 -->
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>
14 <H1><A NAME="SEC45" HREF="gettext_toc.html#TOC45">7 Updating Existing PO Files</A></H1>
18 <H2><A NAME="SEC46" HREF="gettext_toc.html#TOC46">7.1 Invoking the <CODE>msgmerge</CODE> Program</A></H2>
20 <P>
21 <A NAME="IDX276"></A>
22 <A NAME="IDX277"></A>
24 <PRE>
25 msgmerge [<VAR>option</VAR>] <VAR>def</VAR>.po <VAR>ref</VAR>.pot
26 </PRE>
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.
40 </P>
43 <H3><A NAME="SEC47" HREF="gettext_toc.html#TOC47">7.1.1 Input file location</A></H3>
45 <DL COMPACT>
47 <DT><SAMP>&lsquo;<VAR>def</VAR>.po&rsquo;</SAMP>
48 <DD>
49 Translations referring to old sources.
51 <DT><SAMP>&lsquo;<VAR>ref</VAR>.pot&rsquo;</SAMP>
52 <DD>
53 References to the new sources.
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="IDX278"></A>
60 <A NAME="IDX279"></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.
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="IDX280"></A>
70 <A NAME="IDX281"></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.
74 </DL>
78 <H3><A NAME="SEC48" HREF="gettext_toc.html#TOC48">7.1.2 Operation mode</A></H3>
80 <DL COMPACT>
82 <DT><SAMP>&lsquo;-U&rsquo;</SAMP>
83 <DD>
84 <DT><SAMP>&lsquo;--update&rsquo;</SAMP>
85 <DD>
86 <A NAME="IDX282"></A>
87 <A NAME="IDX283"></A>
88 Update <VAR>def</VAR>.po. Do nothing if <VAR>def</VAR>.po is already up to date.
90 </DL>
94 <H3><A NAME="SEC49" HREF="gettext_toc.html#TOC49">7.1.3 Output file location</A></H3>
96 <DL COMPACT>
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="IDX284"></A>
103 <A NAME="IDX285"></A>
104 Write output to specified file.
106 </DL>
109 <A NAME="IDX286"></A>
110 The results are written to standard output if no output file is specified
111 or if it is <SAMP>&lsquo;-&rsquo;</SAMP>.
113 </P>
116 <H3><A NAME="SEC50" HREF="gettext_toc.html#TOC50">7.1.4 Output file location in update mode</A></H3>
119 The result is written back to <VAR>def</VAR>.po.
121 </P>
122 <DL COMPACT>
124 <DT><SAMP>&lsquo;--backup=<VAR>control</VAR>&rsquo;</SAMP>
125 <DD>
126 <A NAME="IDX287"></A>
127 <A NAME="IDX288"></A>
128 Make a backup of <VAR>def</VAR>.po
130 <DT><SAMP>&lsquo;--suffix=<VAR>suffix</VAR>&rsquo;</SAMP>
131 <DD>
132 <A NAME="IDX289"></A>
133 Override the usual backup suffix.
135 </DL>
138 <A NAME="IDX290"></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:
143 </P>
144 <DL COMPACT>
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).
152 <DT><SAMP>&lsquo;numbered&rsquo;</SAMP>
153 <DD>
154 <DT><SAMP>&lsquo;t&rsquo;</SAMP>
155 <DD>
156 Make numbered backups.
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.
165 <DT><SAMP>&lsquo;simple&rsquo;</SAMP>
166 <DD>
167 <DT><SAMP>&lsquo;never&rsquo;</SAMP>
168 <DD>
169 Always make simple backups.
171 </DL>
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.
177 </P>
180 <H3><A NAME="SEC51" HREF="gettext_toc.html#TOC51">7.1.5 Operation modifiers</A></H3>
182 <DL COMPACT>
184 <DT><SAMP>&lsquo;-m&rsquo;</SAMP>
185 <DD>
186 <DT><SAMP>&lsquo;--multi-domain&rsquo;</SAMP>
187 <DD>
188 <A NAME="IDX291"></A>
189 <A NAME="IDX292"></A>
190 Apply <VAR>ref</VAR>.pot to each of the domains in <VAR>def</VAR>.po.
192 <DT><SAMP>&lsquo;-N&rsquo;</SAMP>
193 <DD>
194 <DT><SAMP>&lsquo;--no-fuzzy-matching&rsquo;</SAMP>
195 <DD>
196 <A NAME="IDX293"></A>
197 <A NAME="IDX294"></A>
198 Do not use fuzzy matching when an exact match is not found. This may speed
199 up the operation considerably.
201 <DT><SAMP>&lsquo;--previous&rsquo;</SAMP>
202 <DD>
203 <A NAME="IDX295"></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>
210 <H3><A NAME="SEC52" HREF="gettext_toc.html#TOC52">7.1.6 Input file syntax</A></H3>
212 <DL COMPACT>
214 <DT><SAMP>&lsquo;-P&rsquo;</SAMP>
215 <DD>
216 <DT><SAMP>&lsquo;--properties-input&rsquo;</SAMP>
217 <DD>
218 <A NAME="IDX296"></A>
219 <A NAME="IDX297"></A>
220 Assume the input files are Java ResourceBundles in Java <CODE>.properties</CODE>
221 syntax, not in PO file syntax.
223 <DT><SAMP>&lsquo;--stringtable-input&rsquo;</SAMP>
224 <DD>
225 <A NAME="IDX298"></A>
226 Assume the input files are NeXTstep/GNUstep localized resource files in
227 <CODE>.strings</CODE> syntax, not in PO file syntax.
229 </DL>
233 <H3><A NAME="SEC53" HREF="gettext_toc.html#TOC53">7.1.7 Output details</A></H3>
235 <DL COMPACT>
237 <DT><SAMP>&lsquo;--lang=<VAR>catalogname</VAR>&rsquo;</SAMP>
238 <DD>
239 <A NAME="IDX299"></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.
246 <DT><SAMP>&lsquo;--color&rsquo;</SAMP>
247 <DD>
248 <DT><SAMP>&lsquo;--color=<VAR>when</VAR>&rsquo;</SAMP>
249 <DD>
250 <A NAME="IDX300"></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.
254 <DT><SAMP>&lsquo;--style=<VAR>style_file</VAR>&rsquo;</SAMP>
255 <DD>
256 <A NAME="IDX301"></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.
260 <DT><SAMP>&lsquo;--force-po&rsquo;</SAMP>
261 <DD>
262 <A NAME="IDX302"></A>
263 Always write an output file even if it contains no message.
265 <DT><SAMP>&lsquo;-i&rsquo;</SAMP>
266 <DD>
267 <DT><SAMP>&lsquo;--indent&rsquo;</SAMP>
268 <DD>
269 <A NAME="IDX303"></A>
270 <A NAME="IDX304"></A>
271 Write the .po file using indented style.
273 <DT><SAMP>&lsquo;--no-location&rsquo;</SAMP>
274 <DD>
275 <A NAME="IDX305"></A>
276 Do not write <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines.
278 <DT><SAMP>&lsquo;--add-location&rsquo;</SAMP>
279 <DD>
280 <A NAME="IDX306"></A>
281 Generate <SAMP>&lsquo;#: <VAR>filename</VAR>:<VAR>line</VAR>&rsquo;</SAMP> lines (default).
283 <DT><SAMP>&lsquo;--strict&rsquo;</SAMP>
284 <DD>
285 <A NAME="IDX307"></A>
286 Write out a strict Uniforum conforming PO file. Note that this
287 Uniforum format should be avoided because it doesn't support the
288 GNU extensions.
290 <DT><SAMP>&lsquo;-p&rsquo;</SAMP>
291 <DD>
292 <DT><SAMP>&lsquo;--properties-output&rsquo;</SAMP>
293 <DD>
294 <A NAME="IDX308"></A>
295 <A NAME="IDX309"></A>
296 Write out a Java ResourceBundle in Java <CODE>.properties</CODE> syntax. Note
297 that this file format doesn't support plural forms and silently drops
298 obsolete messages.
300 <DT><SAMP>&lsquo;--stringtable-output&rsquo;</SAMP>
301 <DD>
302 <A NAME="IDX310"></A>
303 Write out a NeXTstep/GNUstep localized resource file in <CODE>.strings</CODE> syntax.
304 Note that this file format doesn't support plural forms.
306 <DT><SAMP>&lsquo;-w <VAR>number</VAR>&rsquo;</SAMP>
307 <DD>
308 <DT><SAMP>&lsquo;--width=<VAR>number</VAR>&rsquo;</SAMP>
309 <DD>
310 <A NAME="IDX311"></A>
311 <A NAME="IDX312"></A>
312 Set the output page width. Long strings in the output files will be
313 split across multiple lines in order to ensure that each line's width
314 (= number of screen columns) is less or equal to the given <VAR>number</VAR>.
316 <DT><SAMP>&lsquo;--no-wrap&rsquo;</SAMP>
317 <DD>
318 <A NAME="IDX313"></A>
319 Do not break long message lines. Message lines whose width exceeds the
320 output page width will not be split into several lines. Only file reference
321 lines which are wider than the output page width will be split.
323 <DT><SAMP>&lsquo;-s&rsquo;</SAMP>
324 <DD>
325 <DT><SAMP>&lsquo;--sort-output&rsquo;</SAMP>
326 <DD>
327 <A NAME="IDX314"></A>
328 <A NAME="IDX315"></A>
329 <A NAME="IDX316"></A>
330 Generate sorted output. Note that using this option makes it much harder
331 for the translator to understand each message's context.
333 <DT><SAMP>&lsquo;-F&rsquo;</SAMP>
334 <DD>
335 <DT><SAMP>&lsquo;--sort-by-file&rsquo;</SAMP>
336 <DD>
337 <A NAME="IDX317"></A>
338 <A NAME="IDX318"></A>
339 Sort output by file location.
341 </DL>
345 <H3><A NAME="SEC54" HREF="gettext_toc.html#TOC54">7.1.8 Informative output</A></H3>
347 <DL COMPACT>
349 <DT><SAMP>&lsquo;-h&rsquo;</SAMP>
350 <DD>
351 <DT><SAMP>&lsquo;--help&rsquo;</SAMP>
352 <DD>
353 <A NAME="IDX319"></A>
354 <A NAME="IDX320"></A>
355 Display this help and exit.
357 <DT><SAMP>&lsquo;-V&rsquo;</SAMP>
358 <DD>
359 <DT><SAMP>&lsquo;--version&rsquo;</SAMP>
360 <DD>
361 <A NAME="IDX321"></A>
362 <A NAME="IDX322"></A>
363 Output version information and exit.
365 <DT><SAMP>&lsquo;-v&rsquo;</SAMP>
366 <DD>
367 <DT><SAMP>&lsquo;--verbose&rsquo;</SAMP>
368 <DD>
369 <A NAME="IDX323"></A>
370 <A NAME="IDX324"></A>
371 Increase verbosity level.
373 <DT><SAMP>&lsquo;-q&rsquo;</SAMP>
374 <DD>
375 <DT><SAMP>&lsquo;--quiet&rsquo;</SAMP>
376 <DD>
377 <DT><SAMP>&lsquo;--silent&rsquo;</SAMP>
378 <DD>
379 <A NAME="IDX325"></A>
380 <A NAME="IDX326"></A>
381 <A NAME="IDX327"></A>
382 Suppress progress indicators.
384 </DL>
386 <P><HR><P>
387 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>.
388 </BODY>
389 </HTML>