| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd"> |
| <html> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <head> |
| <title>GNU gettext utilities: 7. Updating Existing PO Files</title> |
|
|
| <meta name="description" content="GNU gettext utilities: 7. Updating Existing PO Files"> |
| <meta name="keywords" content="GNU gettext utilities: 7. Updating Existing PO Files"> |
| <meta name="resource-type" content="document"> |
| <meta name="distribution" content="global"> |
| <meta name="Generator" content="texi2html 1.78a"> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| <style type="text/css"> |
| <!-- |
| a.summary-letter {text-decoration: none} |
| pre.display {font-family: serif} |
| pre.format {font-family: serif} |
| pre.menu-comment {font-family: serif} |
| pre.menu-preformatted {font-family: serif} |
| pre.smalldisplay {font-family: serif; font-size: smaller} |
| pre.smallexample {font-size: smaller} |
| pre.smallformat {font-family: serif; font-size: smaller} |
| pre.smalllisp {font-size: smaller} |
| span.roman {font-family:serif; font-weight:normal;} |
| span.sansserif {font-family:sans-serif; font-weight:normal;} |
| ul.toc {list-style: none} |
| --> |
| </style> |
|
|
|
|
| </head> |
|
|
| <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> |
|
|
| <table cellpadding="1" cellspacing="1" border="0"> |
| <tr><td valign="middle" align="left">[<a href="gettext_6.html#SEC53" title="Beginning of this chapter or previous chapter"> << </a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_8.html#SEC71" title="Next chapter"> >> </a>]</td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_21.html#SEC410" title="Index">Index</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> |
| </tr></table> |
|
|
| <hr size="2"> |
| <a name="Updating"></a> |
| <a name="SEC61"></a> |
| <h1 class="chapter"> <a href="gettext_toc.html#TOC57">7. Updating Existing PO Files</a> </h1> |
|
|
|
|
|
|
| <a name="msgmerge-Invocation"></a> |
| <a name="SEC62"></a> |
| <h2 class="section"> <a href="gettext_toc.html#TOC58">7.1 Invoking the <code>msgmerge</code> Program</a> </h2> |
|
|
|
|
| <table><tr><td> </td><td><pre class="example">msgmerge [<var>option</var>] <var>def</var>.po <var>ref</var>.pot |
| </pre></td></tr></table> |
|
|
| <p>The <code>msgmerge</code> program merges two Uniforum style .po files together. |
| The <var>def</var>.po file is an existing PO file with translations which will |
| be taken over to the newly created file as long as they still match; |
| comments will be preserved, but extracted comments and file positions will |
| be discarded. The <var>ref</var>.pot file is the last created PO file with |
| up-to-date source references but old translations, or a PO Template file |
| (generally created by <code>xgettext</code>); any translations or comments |
| in the file will be discarded, however dot comments and file positions |
| will be preserved. Where an exact match cannot be found, fuzzy matching |
| is used to produce better results. |
| </p> |
|
|
| <a name="SEC63"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC59">7.1.1 Input file location</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp><var>def</var>.po</samp>’</dt> |
| <dd><p>Translations referring to old sources. |
| </p> |
| </dd> |
| <dt> ‘<samp><var>ref</var>.pot</samp>’</dt> |
| <dd><p>References to the new sources. |
| </p> |
| </dd> |
| <dt> ‘<samp>-D <var>directory</var></samp>’</dt> |
| <dt> ‘<samp>--directory=<var>directory</var></samp>’</dt> |
| <dd><a name="IDX299"></a> |
| <a name="IDX300"></a> |
| <p>Add <var>directory</var> to the list of directories. Source files are |
| searched relative to this list of directories. The resulting ‘<tt>.po</tt>’ |
| file will be written relative to the current directory, though. |
| </p> |
| </dd> |
| <dt> ‘<samp>-C <var>file</var></samp>’</dt> |
| <dt> ‘<samp>--compendium=<var>file</var></samp>’</dt> |
| <dd><a name="IDX301"></a> |
| <a name="IDX302"></a> |
| <p>Specify an additional library of message translations. See section <a href="gettext_8.html#SEC93">Using Translation Compendia</a>. |
| This option may be specified more than once. |
| </p> |
| </dd> |
| </dl> |
|
|
|
|
| <a name="SEC64"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC60">7.1.2 Operation mode</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>-U</samp>’</dt> |
| <dt> ‘<samp>--update</samp>’</dt> |
| <dd><a name="IDX303"></a> |
| <a name="IDX304"></a> |
| <p>Update <var>def</var>.po. Do nothing if <var>def</var>.po is already up to date. |
| </p> |
| </dd> |
| </dl> |
|
|
|
|
| <a name="SEC65"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC61">7.1.3 Output file location</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>-o <var>file</var></samp>’</dt> |
| <dt> ‘<samp>--output-file=<var>file</var></samp>’</dt> |
| <dd><a name="IDX305"></a> |
| <a name="IDX306"></a> |
| <p>Write output to specified file. |
| </p> |
| </dd> |
| </dl> |
|
|
| <a name="IDX307"></a> |
| <p>The results are written to standard output if no output file is specified |
| or if it is ‘<samp>-</samp>’. |
| </p> |
|
|
| <a name="SEC66"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC62">7.1.4 Output file location in update mode</a> </h3> |
|
|
| <p>The result is written back to <var>def</var>.po. |
| </p> |
| <dl compact="compact"> |
| <dt> ‘<samp>--backup=<var>control</var></samp>’</dt> |
| <dd><a name="IDX308"></a> |
| <a name="IDX309"></a> |
| <p>Make a backup of <var>def</var>.po |
| </p> |
| </dd> |
| <dt> ‘<samp>--suffix=<var>suffix</var></samp>’</dt> |
| <dd><a name="IDX310"></a> |
| <p>Override the usual backup suffix. |
| </p> |
| </dd> |
| </dl> |
|
|
| <a name="IDX311"></a> |
| <p>The version control method may be selected via the <code>--backup</code> option |
| or through the <code>VERSION_CONTROL</code> environment variable. Here are the |
| values: |
| </p> |
| <dl compact="compact"> |
| <dt> ‘<samp>none</samp>’</dt> |
| <dt> ‘<samp>off</samp>’</dt> |
| <dd><p>Never make backups (even if <code>--backup</code> is given). |
| </p> |
| </dd> |
| <dt> ‘<samp>numbered</samp>’</dt> |
| <dt> ‘<samp>t</samp>’</dt> |
| <dd><p>Make numbered backups. |
| </p> |
| </dd> |
| <dt> ‘<samp>existing</samp>’</dt> |
| <dt> ‘<samp>nil</samp>’</dt> |
| <dd><p>Make numbered backups if numbered backups for this file already exist, |
| otherwise make simple backups. |
| </p> |
| </dd> |
| <dt> ‘<samp>simple</samp>’</dt> |
| <dt> ‘<samp>never</samp>’</dt> |
| <dd><p>Always make simple backups. |
| </p> |
| </dd> |
| </dl> |
|
|
| <p>The backup suffix is ‘<samp>~</samp>’, unless set with <code>--suffix</code> or the |
| <code>SIMPLE_BACKUP_SUFFIX</code> environment variable. |
| </p> |
|
|
| <a name="SEC67"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC63">7.1.5 Operation modifiers</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>-m</samp>’</dt> |
| <dt> ‘<samp>--multi-domain</samp>’</dt> |
| <dd><a name="IDX312"></a> |
| <a name="IDX313"></a> |
| <p>Apply <var>ref</var>.pot to each of the domains in <var>def</var>.po. |
| </p> |
| </dd> |
| <dt> ‘<samp>--for-msgfmt</samp>’</dt> |
| <dd><a name="IDX314"></a> |
| <p>Produce a PO file meant for <code>msgfmt</code> only, not for a translator. |
| This option omits untranslated messages, fuzzy messages (except the header |
| entry), and obsolete messages from the output. Also, it omits translator |
| comments and ‘<samp>#: <var>filename</var>:<var>line</var></samp>’ lines from the output. |
| In particular, this option implies ‘<samp>--no-fuzzy-matching</samp>’. |
| </p> |
| </dd> |
| <dt> ‘<samp>-N</samp>’</dt> |
| <dt> ‘<samp>--no-fuzzy-matching</samp>’</dt> |
| <dd><a name="IDX315"></a> |
| <a name="IDX316"></a> |
| <p>Do not use fuzzy matching when an exact match is not found. This may speed |
| up the operation considerably. |
| </p> |
| </dd> |
| <dt> ‘<samp>--previous</samp>’</dt> |
| <dd><a name="IDX317"></a> |
| <p>Keep the previous msgids of translated messages, marked with ‘<samp>#|</samp>’, when |
| adding the fuzzy marker to such messages. |
| </p></dd> |
| </dl> |
|
|
|
|
| <a name="SEC68"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC64">7.1.6 Input file syntax</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>-P</samp>’</dt> |
| <dt> ‘<samp>--properties-input</samp>’</dt> |
| <dd><a name="IDX318"></a> |
| <a name="IDX319"></a> |
| <p>Assume the input files are Java ResourceBundles in Java <code>.properties</code> |
| syntax, not in PO file syntax. |
| </p> |
| </dd> |
| <dt> ‘<samp>--stringtable-input</samp>’</dt> |
| <dd><a name="IDX320"></a> |
| <p>Assume the input files are NeXTstep/GNUstep localized resource files in |
| <code>.strings</code> syntax, not in PO file syntax. |
| </p> |
| </dd> |
| </dl> |
|
|
|
|
| <a name="SEC69"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC65">7.1.7 Output details</a> </h3> |
|
|
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>--lang=<var>catalogname</var></samp>’</dt> |
| <dd><a name="IDX321"></a> |
| <p>Specify the ‘<samp>Language</samp>’ field to be used in the header entry. See |
| <a href="gettext_6.html#SEC60">Filling in the Header Entry</a> for the meaning of this field. Note: The |
| ‘<samp>Language-Team</samp>’ and ‘<samp>Plural-Forms</samp>’ fields are left unchanged. |
| If this option is not specified, the ‘<samp>Language</samp>’ field is inferred, as |
| best as possible, from the ‘<samp>Language-Team</samp>’ field. |
| </p> |
| </dd> |
| <dt> ‘<samp>--color</samp>’</dt> |
| <dt> ‘<samp>--color=<var>when</var></samp>’</dt> |
| <dd><a name="IDX322"></a> |
| <p>Specify whether or when to use colors and other text attributes. |
| See <a href="gettext_9.html#SEC171">The <code>--color</code> option</a> for details. |
| </p> |
| </dd> |
| <dt> ‘<samp>--style=<var>style_file</var></samp>’</dt> |
| <dd><a name="IDX323"></a> |
| <p>Specify the CSS style rule file to use for <code>--color</code>. |
| See <a href="gettext_9.html#SEC173">The <code>--style</code> option</a> for details. |
| </p> |
| </dd> |
| <dt> ‘<samp>--force-po</samp>’</dt> |
| <dd><a name="IDX324"></a> |
| <p>Always write an output file even if it contains no message. |
| </p> |
| </dd> |
| <dt> ‘<samp>-i</samp>’</dt> |
| <dt> ‘<samp>--indent</samp>’</dt> |
| <dd><a name="IDX325"></a> |
| <a name="IDX326"></a> |
| <p>Write the .po file using indented style. |
| </p> |
| </dd> |
| <dt> ‘<samp>--no-location</samp>’</dt> |
| <dd><a name="IDX327"></a> |
| <p>Do not write ‘<samp>#: <var>filename</var>:<var>line</var></samp>’ lines. |
| </p> |
| </dd> |
| <dt> ‘<samp>-n</samp>’</dt> |
| <dt> ‘<samp>--add-location=<var>type</var></samp>’</dt> |
| <dd><a name="IDX328"></a> |
| <p>Generate ‘<samp>#: <var>filename</var>:<var>line</var></samp>’ lines (default). |
| </p> |
| <p>The optional <var>type</var> can be either ‘<samp>full</samp>’, ‘<samp>file</samp>’, or |
| ‘<samp>never</samp>’. If it is not given or ‘<samp>full</samp>’, it generates the |
| lines with both file name and line number. If it is ‘<samp>file</samp>’, the |
| line number part is omitted. If it is ‘<samp>never</samp>’, it completely |
| suppresses the lines (same as <code>--no-location</code>). |
| </p> |
| </dd> |
| <dt> ‘<samp>--strict</samp>’</dt> |
| <dd><a name="IDX329"></a> |
| <p>Write out a strict Uniforum conforming PO file. Note that this |
| Uniforum format should be avoided because it doesn't support the |
| GNU extensions. |
| </p> |
| </dd> |
| <dt> ‘<samp>-p</samp>’</dt> |
| <dt> ‘<samp>--properties-output</samp>’</dt> |
| <dd><a name="IDX330"></a> |
| <a name="IDX331"></a> |
| <p>Write out a Java ResourceBundle in Java <code>.properties</code> syntax. Note |
| that this file format doesn't support plural forms and silently drops |
| obsolete messages. |
| </p> |
| </dd> |
| <dt> ‘<samp>--stringtable-output</samp>’</dt> |
| <dd><a name="IDX332"></a> |
| <p>Write out a NeXTstep/GNUstep localized resource file in <code>.strings</code> syntax. |
| Note that this file format doesn't support plural forms. |
| </p> |
| </dd> |
| <dt> ‘<samp>-w <var>number</var></samp>’</dt> |
| <dt> ‘<samp>--width=<var>number</var></samp>’</dt> |
| <dd><a name="IDX333"></a> |
| <a name="IDX334"></a> |
| <p>Set the output page width. Long strings in the output files will be |
| split across multiple lines in order to ensure that each line's width |
| (= number of screen columns) is less or equal to the given <var>number</var>. |
| </p> |
| </dd> |
| <dt> ‘<samp>--no-wrap</samp>’</dt> |
| <dd><a name="IDX335"></a> |
| <p>Do not break long message lines. Message lines whose width exceeds the |
| output page width will not be split into several lines. Only file reference |
| lines which are wider than the output page width will be split. |
| </p> |
| </dd> |
| <dt> ‘<samp>-s</samp>’</dt> |
| <dt> ‘<samp>--sort-output</samp>’</dt> |
| <dd><a name="IDX336"></a> |
| <a name="IDX337"></a> |
| <a name="IDX338"></a> |
| <p>Generate sorted output (deprecated). Note that using this option makes it |
| much harder for the translator to understand each message's context. |
| </p> |
| </dd> |
| <dt> ‘<samp>-F</samp>’</dt> |
| <dt> ‘<samp>--sort-by-file</samp>’</dt> |
| <dd><a name="IDX339"></a> |
| <a name="IDX340"></a> |
| <p>Sort output by file location. |
| </p> |
| </dd> |
| </dl> |
|
|
|
|
| <a name="SEC70"></a> |
| <h3 class="subsection"> <a href="gettext_toc.html#TOC66">7.1.8 Informative output</a> </h3> |
|
|
| <dl compact="compact"> |
| <dt> ‘<samp>-h</samp>’</dt> |
| <dt> ‘<samp>--help</samp>’</dt> |
| <dd><a name="IDX341"></a> |
| <a name="IDX342"></a> |
| <p>Display this help and exit. |
| </p> |
| </dd> |
| <dt> ‘<samp>-V</samp>’</dt> |
| <dt> ‘<samp>--version</samp>’</dt> |
| <dd><a name="IDX343"></a> |
| <a name="IDX344"></a> |
| <p>Output version information and exit. |
| </p> |
| </dd> |
| <dt> ‘<samp>-v</samp>’</dt> |
| <dt> ‘<samp>--verbose</samp>’</dt> |
| <dd><a name="IDX345"></a> |
| <a name="IDX346"></a> |
| <p>Increase verbosity level. |
| </p> |
| </dd> |
| <dt> ‘<samp>-q</samp>’</dt> |
| <dt> ‘<samp>--quiet</samp>’</dt> |
| <dt> ‘<samp>--silent</samp>’</dt> |
| <dd><a name="IDX347"></a> |
| <a name="IDX348"></a> |
| <a name="IDX349"></a> |
| <p>Suppress progress indicators. |
| </p> |
| </dd> |
| </dl> |
|
|
|
|
| <table cellpadding="1" cellspacing="1" border="0"> |
| <tr><td valign="middle" align="left">[<a href="#SEC61" title="Beginning of this chapter or previous chapter"> << </a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_8.html#SEC71" title="Next chapter"> >> </a>]</td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left"> </td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Top" title="Cover (top) of document">Top</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_21.html#SEC410" title="Index">Index</a>]</td> |
| <td valign="middle" align="left">[<a href="gettext_abt.html#SEC_About" title="About (help)"> ? </a>]</td> |
| </tr></table> |
| <p> |
| <font size="-1"> |
| This document was generated by <em>Bruno Haible</em> on <em>July, 2 2025</em> using <a href="https://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>. |
| </font> |
| <br> |
|
|
| </p> |
| </body> |
| </html> |
|
|