2025-03-14 21:59:59 -06:00
|
|
|
# xgettext
|
|
|
|
|
|
|
|
|
|
> Extract gettext strings from code files.
|
|
|
|
|
> More information: <https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html>.
|
|
|
|
|
|
|
|
|
|
- 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}}`
|