gettext / robo
Robo任务用于管理gettext
v4.1.0
2022-03-01 22:16 UTC
Requires
- php: ^7.2|^8.0
- consolidation/robo: ^2.0
- gettext/gettext: ^5.0.0
Requires (Dev)
Suggests
- gettext/json: Is necessary to load and generate json files
- gettext/translator: Is necessary to load and generate php array files
README
使用Robo任务从文件中提取gettext值,使用gettext/gettext库
由Oscar Otero创建 http://oscarotero.com oom@oscarotero.com (MIT许可证)
安装
使用composer
composer require gettext/robo
使用示例
创建一个RoboFile.php文件,代码如下
require 'vendor/autoload.php'; use Robo\Tasks; class RoboFile extends Robo\Tasks { use Gettext\Robo\Gettext; /** * Scan files to find new gettext values */ public function gettext() { $this->taskGettext() //Scan folders with php files ->scan('templates/', '/\.php$/') ->scan('other-files/', '/\.php$/') //Save the domain1 ->save('domain1', 'Locale/es/LC_MESSAGES/domain1.po') ->save('domain1', 'Locale/gl/LC_MESSAGES/domain1.po') //Save the domain2 ->save('domain2', 'Locale/es/LC_MESSAGES/domain1.po') ->save('domain2', 'Locale/gl/LC_MESSAGES/domain1.po') ->run(); } }
使用robo运行代码
robo gettext
请参阅变更日志以获取有关最近更改的更多信息。
MIT许可证(MIT)。有关更多信息,请参阅许可证。