voda / gettext-extractor
提取 gettext 消息的工具
v4.0.5
2021-10-11 21:38 UTC
Requires
- php: >=7.2.0
- latte/latte: ^2.5
- nette/utils: ^3.0
- nikic/php-parser: ^4.2
Requires (Dev)
- phpstan/phpstan: ^0.11.5
- phpstan/phpstan-phpunit: ^0.11.0
- phpstan/phpstan-strict-rules: ^0.11.0
- phpunit/phpunit: ^8
README
提取 PHP 文件和 Latte 模板中的 gettext 短语的工具。输出以 .pot 文件生成。
安装
要安装 gettext-extractor,请使用 composer 安装: $ composer require --dev voda/gettext-extractor
或者您可以从 发布页面 下载独立的 PHAR 文件。
使用方法
./vendor/bin/gettext-extractor [选项]
Options:
-h display this help and exit
-oFILE output file, default output is stdout
-lFILE log file, default is stderr
-fFILE file to extract, can be specified several times
-kFUNCTION add FUNCTION to filters, format is:
FILTER:FUNCTION_NAME:SINGULAR,PLURAL,CONTEXT
default FILTERs are PHP and Latte
for SINGULAR, PLURAL and CONTEXT '0' means not set
can be specified several times
-mKEY:VALUE set meta header
例如: ./vendor/bin/gettext-extractor -o output/file.pot -f files/to/extract/
支持文件类型
- .php
- .latte (Nette Latte 模板)
许可证
GettextExtractor 在新 BSD 许可证下授权。
基于 Karel Klíma 的代码。