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 msguniq 6@cindex @code{msguniq} program, usage 7@example 8msguniq [@var{option}] [@var{inputfile}] 9@end example 10 11@cindex unify duplicate translations 12@cindex duplicate removal 13The @code{msguniq} program unifies duplicate translations in a translation 14catalog. It finds duplicate translations of the same message ID. Such 15duplicates are invalid input for other programs like @code{msgfmt}, 16@code{msgmerge} or @code{msgcat}. By default, duplicates are merged 17together. When using the @samp{--repeated} option, only duplicates are 18output, and all other messages are discarded. Comments and extracted 19comments will be cumulated, except that if @samp{--use-first} is 20specified, they will be taken from the first translation. File positions 21will be cumulated. When using the @samp{--unique} option, duplicates are 22discarded. 23 24@subsection Input file location 25 26@table @samp 27@item @var{inputfile} 28Input PO file. 29 30@item -D @var{directory} 31@itemx --directory=@var{directory} 32@opindex -D@r{, @code{msguniq} option} 33@opindex --directory@r{, @code{msguniq} option} 34Add @var{directory} to the list of directories. Source files are 35searched relative to this list of directories. The resulting @file{.po} 36file will be written relative to the current directory, though. 37 38@end table 39 40If no @var{inputfile} is given or if it is @samp{-}, standard input is read. 41 42@subsection Output file location 43 44@table @samp 45@item -o @var{file} 46@itemx --output-file=@var{file} 47@opindex -o@r{, @code{msguniq} option} 48@opindex --output-file@r{, @code{msguniq} option} 49Write output to specified file. 50 51@end table 52 53The results are written to standard output if no output file is specified 54or if it is @samp{-}. 55 56@subsection Message selection 57 58@table @samp 59@item -d 60@itemx --repeated 61@opindex -d@r{, @code{msguniq} option} 62@opindex --repeated@r{, @code{msguniq} option} 63Print only duplicates. 64 65@item -u 66@itemx --unique 67@opindex -u@r{, @code{msguniq} option} 68@opindex --unique@r{, @code{msguniq} option} 69Print only unique messages, discard duplicates. 70 71@end table 72 73@subsection Input file syntax 74 75@table @samp 76@item -P 77@itemx --properties-input 78@opindex -P@r{, @code{msguniq} option} 79@opindex --properties-input@r{, @code{msguniq} option} 80Assume the input file is a Java ResourceBundle in Java @code{.properties} 81syntax, not in PO file syntax. 82 83@item --stringtable-input 84@opindex --stringtable-input@r{, @code{msguniq} option} 85Assume the input file is a NeXTstep/GNUstep localized resource file in 86@code{.strings} syntax, not in PO file syntax. 87 88@end table 89 90@subsection Output details 91 92@c --no-escape and --escape omitted on purpose. They are not useful. 93 94@table @samp 95@item -t 96@itemx --to-code=@var{name} 97@opindex -t@r{, @code{msguniq} option} 98@opindex --to-code@r{, @code{msguniq} option} 99Specify encoding for output. 100 101@item --use-first 102@opindex --use-first@r{, @code{msguniq} option} 103Use first available translation for each message. Don't merge several 104translations into one. 105 106@item --color 107@itemx --color=@var{when} 108@opindex --color@r{, @code{msguniq} option} 109Specify whether or when to use colors and other text attributes. 110See @ref{The --color option} for details. 111 112@item --style=@var{style_file} 113@opindex --style@r{, @code{msguniq} option} 114Specify the CSS style rule file to use for @code{--color}. 115See @ref{The --style option} for details. 116 117@item --force-po 118@opindex --force-po@r{, @code{msguniq} option} 119Always write an output file even if it contains no message. 120 121@item -i 122@itemx --indent 123@opindex -i@r{, @code{msguniq} option} 124@opindex --indent@r{, @code{msguniq} option} 125Write the .po file using indented style. 126 127@item --no-location 128@opindex --no-location@r{, @code{msguniq} option} 129Do not write @samp{#: @var{filename}:@var{line}} lines. 130 131@item -n 132@itemx --add-location=@var{type} 133@opindex -n@r{, @code{msguniq} option} 134@opindex --add-location@r{, @code{msguniq} option} 135Generate @samp{#: @var{filename}:@var{line}} lines (default). 136 137The optional @var{type} can be either @samp{full}, @samp{file}, or 138@samp{never}. If it is not given or @samp{full}, it generates the 139lines with both file name and line number. If it is @samp{file}, the 140line number part is omitted. If it is @samp{never}, it completely 141suppresses the lines (same as @code{--no-location}). 142 143@item --strict 144@opindex --strict@r{, @code{msguniq} option} 145Write out a strict Uniforum conforming PO file. Note that this 146Uniforum format should be avoided because it doesn't support the 147GNU extensions. 148 149@item -p 150@itemx --properties-output 151@opindex -p@r{, @code{msguniq} option} 152@opindex --properties-output@r{, @code{msguniq} option} 153Write out a Java ResourceBundle in Java @code{.properties} syntax. Note 154that this file format doesn't support plural forms and silently drops 155obsolete messages. 156 157@item --stringtable-output 158@opindex --stringtable-output@r{, @code{msguniq} option} 159Write out a NeXTstep/GNUstep localized resource file in @code{.strings} syntax. 160Note that this file format doesn't support plural forms. 161 162@item -w @var{number} 163@itemx --width=@var{number} 164@opindex -w@r{, @code{msguniq} option} 165@opindex --width@r{, @code{msguniq} option} 166Set the output page width. Long strings in the output files will be 167split across multiple lines in order to ensure that each line's width 168(= number of screen columns) is less or equal to the given @var{number}. 169 170@item --no-wrap 171@opindex --no-wrap@r{, @code{msguniq} option} 172Do not break long message lines. Message lines whose width exceeds the 173output page width will not be split into several lines. Only file reference 174lines which are wider than the output page width will be split. 175 176@item -s 177@itemx --sort-output 178@opindex -s@r{, @code{msguniq} option} 179@opindex --sort-output@r{, @code{msguniq} option} 180Generate sorted output. Note that using this option makes it much harder 181for the translator to understand each message's context. 182 183@item -F 184@itemx --sort-by-file 185@opindex -F@r{, @code{msguniq} option} 186@opindex --sort-by-file@r{, @code{msguniq} option} 187Sort output by file location. 188 189@end table 190 191@subsection Informative output 192 193@table @samp 194@item -h 195@itemx --help 196@opindex -h@r{, @code{msguniq} option} 197@opindex --help@r{, @code{msguniq} option} 198Display this help and exit. 199 200@item -V 201@itemx --version 202@opindex -V@r{, @code{msguniq} option} 203@opindex --version@r{, @code{msguniq} option} 204Output version information and exit. 205 206@end table 207