mirror of
https://github.com/friendica/friendica
synced 2025-04-26 06:30:11 +00:00
bug #159 multiple definition of string_plural_form function when changing languages
This commit is contained in:
parent
11ca81adba
commit
c63adcfae0
9 changed files with 551 additions and 24 deletions
|
@ -10,7 +10,14 @@ function po2php_run($argv, $argc) {
|
|||
|
||||
$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;
|
||||
|
@ -37,7 +44,7 @@ function po2php_run($argv, $argc) {
|
|||
$match=Array();
|
||||
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";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue