msgcat â concatenate and merge PO files
msgcat [OPTION] [INPUTFILE]...
| Use Case | Command | Description |
|---|---|---|
| Concatenate PO files | msgcat file1.po file2.po | Merge multiple PO files into one |
| Find common messages | msgcat --more-than=2 *.po | Show messages that appear in more than 2 files |
| Find unique messages | msgcat --unique *.po | Show messages that appear in only one file |
| Specify output file | msgcat -o output.po file.po | Write merged output to a file |
| Use first translation | msgcat --use-first file.po | Keep first translation instead of merging |
| Change output encoding | msgcat -t UTF-8 file.po | Convert to specified encoding |
The msgcat program concatenates and merges the specified PO files. It finds messages which are common to two or more of the specified PO files. By using the --more-than option, greater commonality may be requested before messages are printed. Conversely, the --less-than option may be used to specify less commonality before messages are printed (i.e. --less-than=2 will only print the unique messages). Translations, comments, extracted comments, and file positions will be cumulated, except that if --use-first is specified, they will be taken from the first PO file to define them.
To concatenate POT files, better use xgettext, not msgcat, because msgcat would choke on the undefined charsets in the specified POT files.
INPUTFILE ... â Input files.-f FILE, --files-from=FILE â Read the names of the input files from FILE instead of getting them from the command line.-D DIRECTORY, --directory=DIRECTORY â Add DIRECTORY to the list of directories. Source files are searched relative to this list of directories. The resulting .po file will be written relative to the current directory, though.If INPUTFILE is -, standard input is read.
-o FILE, --output-file=FILE â Write output to specified file.The results are written to standard output if no output file is specified or if it is -.
-< NUMBER, --less-than=NUMBER â Print messages with less than NUMBER definitions, defaults to infinite if not set.-> NUMBER, --more-than=NUMBER â Print messages with more than NUMBER definitions, defaults to 0 if not set.-u, --unique â Shorthand for --less-than=2. Requests that only unique messages be printed.-P, --properties-input â Assume the input files are Java ResourceBundles in Java .properties syntax, not in PO file syntax.--stringtable-input â Assume the input files are NeXTstep/GNUstep localized resource files in .strings syntax, not in PO file syntax.-t, --to-code=NAME â Specify encoding for output.--use-first â Use first available translation for each message. Don't merge several translations into one.--lang=CATALOGNAME â Specify the Language field to be used in the header entry. See Header Entry for the meaning of this field. Note: The Language-Team and Plural-Forms fields are left unchanged.--color, --color=WHEN â Specify whether or when to use colors and other text attributes. See The --color option for details.--style=STYLE_FILE â Specify the CSS style rule file to use for --color. See The --style option for details.--force-po â Always write an output file even if it contains no message.-i, --indent â Write the .po file using indented style.--no-location â Do not write #: FILENAME:LINE lines.-n, --add-location=TYPE â Generate #: FILENAME:LINE lines (default). The optional TYPE can be either full, file, or never. If it is not given or full, it generates the lines with both file name and line number. If it is file, the line number part is omitted. If it is never, it completely suppresses the lines (same as --no-location).--strict â 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, --properties-output â Write out a Java ResourceBundle in Java .properties syntax. Note that this file format doesn't support plural forms and silently drops obsolete messages.--stringtable-output â Write out a NeXTstep/GNUstep localized resource file in .strings syntax. Note that this file format doesn't support plural forms.-w NUMBER, --width=NUMBER â 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 NUMBER.--no-wrap â 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.-s, --sort-output â Generate sorted output. Note that using this option makes it much harder for the translator to understand each message's context.-F, --sort-by-file â Sort output by file location.-h, --help â Display this help and exit.-V, --version â Output version information and exit.Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 09:07 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format