Skip to content
XLIFF i18n file generator
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
generated [add] gitignore Jun 16, 2014
.gitignore [fix] gitignore Jun 16, 2014
README.es.md [add] readme in spanish Jun 17, 2014
README.md [chg] update readme content with use instructions Jun 16, 2014
README.pt_BR.md [add] readme in spanish Jun 17, 2014
xliff-generator.class.php [add] xliff i18n files generator Jun 16, 2014
xliff-generator.php [chg] sample parameters Jun 16, 2014

README.md

xliff-file-generator

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.

Requeriments

PHP 5.3 >=

Installation / Usage

  1. Run git clone https://github.com/laborautonomo/xliff-file-generator.git

  2. The "generated" folder require 777 write permission

  3. 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\}");

Executing

$ php xliff-generator.php

Virtaal to make translation

Virtaal is easy-to-use and powerful offline translation tool. It's found here

Using

  1. Install Virtaal # aptitude install virtaal or use repository documentation here

  2. Open Virtaal program and select the generated files with xliff-file-gerador

You can’t perform that action at this time.