Files
tldr/pages.zh/common/xgettext.md

20 lines
589 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# xgettext
> 从代码文件中提取gettext字符串。
> 更多信息:<https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html>。
- 扫描文件并将字符串输出到 `messages.po`
`xgettext {{path/to/input_file}}`
- 使用不同的输出文件名:
`xgettext --output {{path/to/output_file}} {{path/to/input_file}}`
- 将新字符串附加到现有文件:
`xgettext --join-existing --output {{path/to/output_file}} {{path/to/input_file}}`
- 不在输出文件中添加包含元数据的头部:
`xgettext --omit-header {{path/to/input_file}}`