1@c This file is part of the GNU gettext manual. 2@c Copyright (C) 1995-2019 Free Software Foundation, Inc. 3@c See the file gettext.texi for copying conditions. 4 5@pindex msgmerge 6@cindex @code{msgmerge} program, usage 7@example 8msgmerge [@var{option}] @var{def}.po @var{ref}.pot 9@end example 10 11The @code{msgmerge} program merges two Uniforum style .po files together. 12The @var{def}.po file is an existing PO file with translations which will 13be taken over to the newly created file as long as they still match; 14comments will be preserved, but extracted comments and file positions will 15be discarded. The @var{ref}.pot file is the last created PO file with 16up-to-date source references but old translations, or a PO Template file 17(generally created by @code{xgettext}); any translations or comments 18in the file will be discarded, however dot comments and file positions 19will be preserved. Where an exact match cannot be found, fuzzy matching 20is used to produce better results. 21 22@subsection Input file location 23 24@table @samp 25@item @var{def}.po 26Translations referring to old sources. 27 28@item @var{ref}.pot 29References to the new sources. 30 31@item -D @var{directory} 32@itemx --directory=@var{directory} 33@opindex -D@r{, @code{msgmerge} option} 34@opindex --directory@r{, @code{msgmerge} option} 35Add @var{directory} to the list of directories. Source files are 36searched relative to this list of directories. The resulting @file{.po} 37file will be written relative to the current directory, though. 38 39@item -C @var{file} 40@itemx --compendium=@var{file} 41@opindex -C@r{, @code{msgmerge} option} 42@opindex --compendium@r{, @code{msgmerge} option} 43Specify an additional library of message translations. @xref{Compendium}. 44This option may be specified more than once. 45 46@end table 47 48@subsection Operation mode 49 50@table @samp 51@item -U 52@itemx --update 53@opindex -U@r{, @code{msgmerge} option} 54@opindex --update@r{, @code{msgmerge} option} 55Update @var{def}.po. Do nothing if @var{def}.po is already up to date. 56 57@end table 58 59@subsection Output file location 60 61@table @samp 62@item -o @var{file} 63@itemx --output-file=@var{file} 64@opindex -o@r{, @code{msgmerge} option} 65@opindex --output-file@r{, @code{msgmerge} option} 66Write output to specified file. 67 68@end table 69 70@cindex standard output, and @code{msgmerge} program 71The results are written to standard output if no output file is specified 72or if it is @samp{-}. 73 74@subsection Output file location in update mode 75 76The result is written back to @var{def}.po. 77 78@table @samp 79@item --backup=@var{control} 80@opindex --backup@r{, @code{msgmerge} option} 81@cindex backup old file, and @code{msgmerge} program 82Make a backup of @var{def}.po 83 84@item --suffix=@var{suffix} 85@opindex --suffix@r{, @code{msgmerge} option} 86Override the usual backup suffix. 87 88@end table 89 90@cindex version control for backup files, @code{msgmerge} 91The version control method may be selected via the @code{--backup} option 92or through the @code{VERSION_CONTROL} environment variable. Here are the 93values: 94 95@table @samp 96@item none 97@itemx off 98Never make backups (even if @code{--backup} is given). 99 100@item numbered 101@itemx t 102Make numbered backups. 103 104@item existing 105@itemx nil 106Make numbered backups if numbered backups for this file already exist, 107otherwise make simple backups. 108 109@item simple 110@itemx never 111Always make simple backups. 112 113@end table 114 115The backup suffix is @samp{~}, unless set with @code{--suffix} or the 116@code{SIMPLE_BACKUP_SUFFIX} environment variable. 117 118@subsection Operation modifiers 119 120@table @samp 121@item -m 122@itemx --multi-domain 123@opindex -m@r{, @code{msgmerge} option} 124@opindex --multi-domain@r{, @code{msgmerge} option} 125Apply @var{ref}.pot to each of the domains in @var{def}.po. 126 127@item --for-msgfmt 128@opindex --for-msgfmt@r{, @code{msgmerge} option} 129Produce a PO file meant for @code{msgfmt} only, not for a translator. 130This option omits untranslated messages, fuzzy messages (except the header 131entry), and obsolete messages from the output. Also, it omits translator 132comments and @samp{#: @var{filename}:@var{line}} lines from the output. 133In particular, this option implies @samp{--no-fuzzy-matching}. 134 135@item -N 136@itemx --no-fuzzy-matching 137@opindex -N@r{, @code{msgmerge} option} 138@opindex --no-fuzzy-matching@r{, @code{msgmerge} option} 139Do not use fuzzy matching when an exact match is not found. This may speed 140up the operation considerably. 141 142@item --previous 143@opindex --previous@r{, @code{msgmerge} option} 144Keep the previous msgids of translated messages, marked with @samp{#|}, when 145adding the fuzzy marker to such messages. 146@end table 147 148@subsection Input file syntax 149 150@table @samp 151@item -P 152@itemx --properties-input 153@opindex -P@r{, @code{msgmerge} option} 154@opindex --properties-input@r{, @code{msgmerge} option} 155Assume the input files are Java ResourceBundles in Java @code{.properties} 156syntax, not in PO file syntax. 157 158@item --stringtable-input 159@opindex --stringtable-input@r{, @code{msgmerge} option} 160Assume the input files are NeXTstep/GNUstep localized resource files in 161@code{.strings} syntax, not in PO file syntax. 162 163@end table 164 165@subsection Output details 166 167@c --no-escape and --escape omitted on purpose. They are not useful. 168 169@table @samp 170@item --lang=@var{catalogname} 171@opindex --lang@r{, @code{msgmerge} option} 172Specify the @samp{Language} field to be used in the header entry. See 173@ref{Header Entry} for the meaning of this field. Note: The 174@samp{Language-Team} and @samp{Plural-Forms} fields are left unchanged. 175If this option is not specified, the @samp{Language} field is inferred, as 176best as possible, from the @samp{Language-Team} field. 177 178@item --color 179@itemx --color=@var{when} 180@opindex --color@r{, @code{msgmerge} option} 181Specify whether or when to use colors and other text attributes. 182See @ref{The --color option} for details. 183 184@item --style=@var{style_file} 185@opindex --style@r{, @code{msgmerge} option} 186Specify the CSS style rule file to use for @code{--color}. 187See @ref{The --style option} for details. 188 189@item --force-po 190@opindex --force-po@r{, @code{msgmerge} option} 191Always write an output file even if it contains no message. 192 193@item -i 194@itemx --indent 195@opindex -i@r{, @code{msgmerge} option} 196@opindex --indent@r{, @code{msgmerge} option} 197Write the .po file using indented style. 198 199@item --no-location 200@opindex --no-location@r{, @code{msgmerge} option} 201Do not write @samp{#: @var{filename}:@var{line}} lines. 202 203@item -n 204@itemx --add-location=@var{type} 205@opindex --add-location@r{, @code{msgmerge} option} 206Generate @samp{#: @var{filename}:@var{line}} lines (default). 207 208The optional @var{type} can be either @samp{full}, @samp{file}, or 209@samp{never}. If it is not given or @samp{full}, it generates the 210lines with both file name and line number. If it is @samp{file}, the 211line number part is omitted. If it is @samp{never}, it completely 212suppresses the lines (same as @code{--no-location}). 213 214@item --strict 215@opindex --strict@r{, @code{msgmerge} option} 216Write out a strict Uniforum conforming PO file. Note that this 217Uniforum format should be avoided because it doesn't support the 218GNU extensions. 219 220@item -p 221@itemx --properties-output 222@opindex -p@r{, @code{msgmerge} option} 223@opindex --properties-output@r{, @code{msgmerge} option} 224Write out a Java ResourceBundle in Java @code{.properties} syntax. Note 225that this file format doesn't support plural forms and silently drops 226obsolete messages. 227 228@item --stringtable-output 229@opindex --stringtable-output@r{, @code{msgmerge} option} 230Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax. 231Note that this file format doesn't support plural forms. 232 233@item -w @var{number} 234@itemx --width=@var{number} 235@opindex -w@r{, @code{msgmerge} option} 236@opindex --width@r{, @code{msgmerge} option} 237Set the output page width. Long strings in the output files will be 238split across multiple lines in order to ensure that each line's width 239(= number of screen columns) is less or equal to the given @var{number}. 240 241@item --no-wrap 242@opindex --no-wrap@r{, @code{msgmerge} option} 243Do not break long message lines. Message lines whose width exceeds the 244output page width will not be split into several lines. Only file reference 245lines which are wider than the output page width will be split. 246 247@item -s 248@itemx --sort-output 249@opindex -s@r{, @code{msgmerge} option} 250@opindex --sort-output@r{, @code{msgmerge} option} 251@cindex sorting @code{msgmerge} output 252Generate sorted output. Note that using this option makes it much harder 253for the translator to understand each message's context. 254 255@item -F 256@itemx --sort-by-file 257@opindex -F@r{, @code{msgmerge} option} 258@opindex --sort-by-file@r{, @code{msgmerge} option} 259Sort output by file location. 260 261@end table 262 263@subsection Informative output 264 265@table @samp 266@item -h 267@itemx --help 268@opindex -h@r{, @code{msgmerge} option} 269@opindex --help@r{, @code{msgmerge} option} 270Display this help and exit. 271 272@item -V 273@itemx --version 274@opindex -V@r{, @code{msgmerge} option} 275@opindex --version@r{, @code{msgmerge} option} 276Output version information and exit. 277 278@item -v 279@itemx --verbose 280@opindex -v@r{, @code{msgmerge} option} 281@opindex --verbose@r{, @code{msgmerge} option} 282Increase verbosity level. 283 284@item -q 285@itemx --quiet 286@itemx --silent 287@opindex -q@r{, @code{msgmerge} option} 288@opindex --quiet@r{, @code{msgmerge} option} 289@opindex --silent@r{, @code{msgmerge} option} 290Suppress progress indicators. 291 292@end table 293