Update build-tools to manage plurals form in php file generated. Closes #1650

2.6
Nicolas 2013-09-14 22:24:01 +02:00
parent a00a2ac622
commit b8940802af
1 changed files with 1 additions and 20 deletions

View File

@ -28,26 +28,7 @@ foreach ($eres as $f)
$dest = dirname($f).'/'.basename($f,'.po').'.lang.php';
echo "l10n file ".$dest.": ";
$l = l10n::getPoFile($f);
$fcontent =
"<?php\n".
$license_block.
"#\n#\n#\n".
"# DOT NOT MODIFY THIS FILE !\n\n\n\n\n";
foreach (l10n::getPoFile($f) as $vo => $tr) {
$vo = str_replace("'","\\'",$vo);
$tr = str_replace("'","\\'",$tr);
$fcontent .= '$GLOBALS[\'__l10n\'][\''.$vo.'\'] = \''.$tr.'\';'."\n";
}
$fcontent .= "?>";
echo $dest.' : ';
if (($fp = fopen($dest,'w')) !== false) {
fwrite($fp,$fcontent,strlen($fcontent));
fclose($fp);
if (l10n::generatePhpFileFromPo(dirname($f).'/'.basename($f,'.po'))) {
echo 'OK';
} else {
echo 'FAILED';