Skip to content

msgcat: add page #16912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
29 changes: 29 additions & 0 deletions pages/common/msgcat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# msgcat

> Concatenate and merge multiple `.po` translation files.
> Useful in software localization pipelines to combine message catalogs with filtering options.
> More information: <https://www.gnu.org/software/gettext/manual/html_node/msgcat-Invocation.html>.

- Combine multiple `.po` files into one:

`msgcat {{file1.po file2.po ...}} > {{combined.po}}`

- Combine input files listed in a text file:

`msgcat --files-from {{path/to/file_list.txt}} > {{combined.po}}`

- Set the output encoding (e.g., UTF-8):

`msgcat --to-code {{UTF-8}} {{input.po}} > {{output.po}}`

- Output only unique messages (appearing in one file only):

`msgcat --unique {{file1.po file2.po ...}} > {{unique.po}}`

- Use the first available translation for duplicate entries:

`msgcat --use-first {{file1.po file2.po ...}} > {{output.po}}`

- Display help:

`msgcat --help`