mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
update translation utils:
po2php: add "if function_exists" around plural select function run_xgettext: add option to extract strings from addon folder
This commit is contained in:
parent
cd8346694b
commit
9d99a531b9
2 changed files with 59 additions and 23 deletions
|
@ -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";
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue