2025-03-14 21:59:59 -06:00
|
|
|
# xgettext
|
|
|
|
|
|
|
|
|
|
> Extract gettext strings from code files.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://www.gnu.org/software/gettext/manual/gettext.html#xgettext-Invocation>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Scan file and output strings to `messages.po`:
|
|
|
|
|
|
|
|
|
|
`xgettext {{path/to/input_file}}`
|
|
|
|
|
|
|
|
|
|
- Use a different output filename:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`xgettext {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Append new strings to an existing file:
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
`xgettext {{[-j|--join-existing]}} {{[-o|--output]}} {{path/to/output_file}} {{path/to/input_file}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Don't add a header containing metadata to the output file:
|
|
|
|
|
|
|
|
|
|
`xgettext --omit-header {{path/to/input_file}}`
|
2025-04-03 20:36:56 -06:00
|
|
|
|
|
|
|
|
- Display help:
|
|
|
|
|
|
|
|
|
|
`xgettext {{[-h|--help]}}`
|