gettext/robo

Robo任务用于管理gettext

v4.1.0 2022-03-01 22:16 UTC

This package is auto-updated.

Last update: 2024-08-29 04:31:01 UTC


README

Latest Version on Packagist Software License Quality Score Total Downloads

使用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)。有关更多信息,请参阅许可证