← 返回命令列表

Linux command

pygettext2.7 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Extract translatable strings

pygettext2.7 [file.py]

Output to specific file

pygettext2.7 -o [messages.pot] [file.py]

Extract from directory

pygettext2.7 -d [domain] [*.py]

说明

pygettext2.7 is the Python 2.7 version of pygettext, which extracts translatable strings from Python source files and generates POT (Portable Object Template) files for internationalization. It scans for strings wrapped in _(), gettext(), and similar marker functions. This version-specific binary targets Python 2.7 code. For Python 3 projects, use the corresponding pygettext3 or the more feature-rich xgettext and Babel alternatives.

参数

-o _FILE_
Output file.
-d _DOMAIN_
Text domain.
-k _KEYWORD_
Additional keyword.

FAQ

What is the pygettext2.7 command used for?

pygettext2.7 is the Python 2.7 version of pygettext, which extracts translatable strings from Python source files and generates POT (Portable Object Template) files for internationalization. It scans for strings wrapped in _(), gettext(), and similar marker functions. This version-specific binary targets Python 2.7 code. For Python 3 projects, use the corresponding pygettext3 or the more feature-rich xgettext and Babel alternatives.

How do I run a basic pygettext2.7 example?

Run `pygettext2.7 [file.py]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _FILE_ do in pygettext2.7?

Output file.