Linux command
msgmerge 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Merge translations with template
msgmerge [old.po] [new.pot] -o [merged.po]
Update PO file in place
msgmerge -U [existing.po] [template.pot]
Merge without fuzzy matching
msgmerge -N [old.po] [new.pot] -o [merged.po]
Merge keeping previous msgids
msgmerge --previous [old.po] [new.pot] -o [merged.po]
Backup before update
msgmerge -U --backup=numbered [file.po] [template.pot]
Use a compendium
msgmerge -C [compendium.po] [old.po] [new.pot] -o [merged.po]
Quiet mode
msgmerge -q [old.po] [new.pot] -o [merged.po]
说明
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).
参数
- -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.
FAQ
What is the msgmerge command used for?
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).
How do I run a basic msgmerge example?
Run `msgmerge [old.po] [new.pot] -o [merged.po]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -o _FILE_ do in msgmerge?
Output file.