gettext / robo
Robo tasks to manage gettext
Installs: 47 551
Dependents: 1
Suggesters: 0
Security: 0
Stars: 7
Watchers: 2
Forks: 6
Open Issues: 4
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 task to extract gettext values from files using gettext/gettext library
Created by Oscar Otero http://oscarotero.com oom@oscarotero.com (MIT License)
Install
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() { $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(); } }
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.