XLIFF (XML Localisation Interchange File Format) i18n files generator.
This project was created from the need to make the internationalization of laborautonomo.org website (developed with Silex PHP micro-framework and Twig template language), which now has its content in Portuguese, English and Spanish.
PHP 5.3 >=
-
Run
git clone https://github.com/laborautonomo/xliff-file-generator.git
-
The "generated" folder require 777 write permission
-
Alter the
xliff-generator.php
configuration file
$xliff_generator->setFolder('set_the_project_path_to_make_i18n');
$xliff_generator->setLanguages(array('pt_BR','en','es'));
$xliff_generator->setExtensions(array('php','twig'));
//this regex to search all words into "->trans(' ... ')" used in Silex Micro-Framework
$xliff_generator->addRegex("->trans\(['\"](.*)['\"]\)");
//this regex to search all words into "{' ... '|trans}" used in Twig Template Language
$xliff_generator->addRegex("\{ *['\"](.*)['\"] *\|trans\}");
$ php xliff-generator.php
Virtaal is easy-to-use and powerful offline translation tool. It's found here
-
Install Virtaal
# aptitude install virtaal
or use repository documentation here -
Open Virtaal program and select the generated files with xliff-file-gerador