$pofile = $argv[1];
$outfile = dirname($pofile)."/strings.php";
-
+
+ if(strstr($outfile,'util'))
+ $lang = 'en';
+ else
+ $lang = str_replace('-','_',basename(dirname($pofile)));
+
+
+
if (!file_exists($pofile)){
print "Unable to find '$pofile'\n";
return;
if ($l[0]=="#") $l="";
if (substr($l,0,15)=='"Plural-Forms: '){
$match=Array();
- preg_match("|nplurals=([0-9]*); *plural=(.*)|", $l, $match);
+ preg_match("|nplurals=([0-9]*); *plural=(.*)[;\\\\]|", $l, $match);
$cond = str_replace('n','$n',$match[2]);
- $out .= 'function string_plural_select($n){'."\n";
+ $out .= 'function string_plural_select_' . $lang . '($n){'."\n";
$out .= ' return '.$cond.';'."\n";
$out .= '}'."\n";
}
}
-
+
if ($inv) { $inv = False; $out .= '"'.$v.'"'; }
if ($k!="") $out .= $arr?");\n":";\n";