]> git.mxchange.org Git - friendica.git/blobdiff - util/po2php.php
merge
[friendica.git] / util / po2php.php
index 147c4a58d0fb33036bbc8f88f3ab7634f4612572..881a9b2679fdb8f3f64afdf92e5b5af5a295714f 100644 (file)
@@ -46,9 +46,12 @@ 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_' . $lang . '($n){'."\n";
+                       // define plural select function if not already defined
+                       $fnname = 'string_plural_select_' . $lang;
+                       $out .= 'if(! function_exists("'.$fnname.'")) {'."\n";
+                       $out .= 'function '. $fnname . '($n){'."\n";
                        $out .= '       return '.$cond.';'."\n";
-                       $out .= '}'."\n";
+                       $out .= '}}'."\n";
                }