gettext-voo4/robo

用于管理gettext的Robo任务

v3.0.2 2018-09-19 11:37 UTC

This package is auto-updated.

Last update: 2024-09-20 01:29:07 UTC


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';

class RoboFile extends \Robo\Tasks
{
    use Gettext\Robo\GettextScanner;

    /**
     * Scan files to find new gettext values
     */
    public function gettext()
    {
        $this->taskGettextScanner()
            ->extract('templates/')
            ->extract('js/', '/.*\.js/') //directory + regex
            ->generate('Locale/gl/LC_MESSAGES/messages.mo')
            ->generate('Locale/es/LC_MESSAGES/messages.mo')
            ->generate('Locale/en/LC_MESSAGES/messages.mo')
            ->run();
    }
}

使用robo运行代码

robo gettext