LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

msgmerge

Merge two Uniforum style PO files

TLDR

Merge translations with template
$ msgmerge [old.po] [new.pot] -o [merged.po]
copy
Update PO file in place
$ msgmerge -U [existing.po] [template.pot]
copy
Merge without fuzzy matching
$ msgmerge -N [old.po] [new.pot] -o [merged.po]
copy
Merge keeping previous msgids on fuzzy matches
$ msgmerge --previous [old.po] [new.pot] -o [merged.po]
copy
Backup before update
$ msgmerge -U --backup=numbered [file.po] [template.pot]
copy
Use a compendium of translations
$ msgmerge -C [compendium.po] [old.po] [new.pot] -o [merged.po]
copy
Quiet mode
$ msgmerge -q [old.po] [new.pot] -o [merged.po]
copy

SYNOPSIS

msgmerge [options] def.po ref.pot

DESCRIPTION

msgmerge merges two Uniforum style .po files together. It is part of GNU gettext.The def.po file is an existing PO file with translations that will be taken over to the newly created file as long as they still match. The ref.pot file is the last created PO template file with up-to-date source references. Comments from def.po are preserved. When an exact match is not found, fuzzy matching is used to produce better results (unless -N is specified).

PARAMETERS

DEF.PO

Existing translations file.
REF.POT
Reference template file.
-o FILE
Output file.
-U, --update
Update def.po in place.
-N, --no-fuzzy-matching
Do not use fuzzy matching. Speeds up operation considerably.
--previous
Keep previous msgids of translated messages when adding fuzzy markers.
-C FILE, --compendium=FILE
Additional library of message translations. May be specified more than once.
--backup=CONTROL
Backup control for -U: none, numbered, existing, or simple.
--suffix=SUFFIX
Override the usual backup suffix.
-q, --quiet
Suppress progress indicators.
-v, --verbose
Increase verbosity level.
--no-wrap
Do not break long message lines.
-s, --sort-output
Generate sorted output.
-F, --sort-by-file
Sort output by file location.

CAVEATS

Part of gettext-tools package. Fuzzy matches are marked with a #, fuzzy comment and should be reviewed. The -U flag modifies the input file in place; use --backup to create backups before updating.

HISTORY

msgmerge is part of GNU gettext, essential for maintaining translation files across software updates.

SEE ALSO

msginit(1), msgfmt(1), msgcat(1), xgettext(1)

Copied to clipboard
Kai