Robo tasks to manage gettext

v4.0.0 2019-11-05 19:56 UTC

This package is auto-updated.

Last update: 2020-09-05 21:37:59 UTC


Latest Version on Packagist Software License Quality Score Total Downloads

Robo task to extract gettext values from files using gettext/gettext library

Created by Oscar Otero (MIT License)


Using composer:

composer require gettext/robo

usage example

Create a RoboFile.php with the following code:

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()
            //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')


Use robo to run the code:

robo gettext

Please see CHANGELOG for more information about recent changes.

The MIT License (MIT). Please see LICENSE for more information.