X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FCore%2FConsole%2FPoToPhp.php;h=e97e1ff3d9cfedd31751f4e1b29ba8e522e0a535;hb=66a103e36a42ab251fd9ca6c4b56b54380e4d535;hp=0a7224503ac3956bdf43f40d6b26f9f143035cab;hpb=850d9b4c0b595e00e5cd7ec40a2e8c0f0569738f;p=friendica.git diff --git a/src/Core/Console/PoToPhp.php b/src/Core/Console/PoToPhp.php index 0a7224503a..e97e1ff3d9 100644 --- a/src/Core/Console/PoToPhp.php +++ b/src/Core/Console/PoToPhp.php @@ -94,11 +94,12 @@ HELP; $fnname = 'string_plural_select_' . $lang; $out .= 'if(! function_exists("' . $fnname . '")) {' . "\n"; $out .= 'function ' . $fnname . '($n){' . "\n"; + $out .= ' $n = intval($n);' . "\n"; $out .= ' return ' . $cond . ';' . "\n"; $out .= '}}' . "\n"; } - if ($k != "" && substr($l, 0, 7) == 'msgstr ') { + if ($k != '' && substr($l, 0, 7) == 'msgstr ') { if ($ink) { $ink = false; $out .= '$a->strings["' . $k . '"] = '; @@ -109,11 +110,12 @@ HELP; $out .= '"' . $v . '"'; } - $v = substr($l, 8, $len - 11); + $v = substr($l, 8, $len - 10); $v = preg_replace_callback($escape_s_exp, [$this, 'escapeDollar'], $v); $inv = true; } + if ($k != "" && substr($l, 0, 7) == 'msgstr[') { if ($ink) { $ink = false; @@ -125,9 +127,10 @@ HELP; } if (!$arr) { - $arr = True; + $arr = true; $out .= "[\n"; } + $match = []; preg_match("|\[([0-9]*)\] (.*)|", $l, $match); $out .= "\t" @@ -152,9 +155,11 @@ HELP; $inv = false; $out .= '"' . $v . '"'; } + if ($k != "") { $out .= ($arr) ? "];\n" : ";\n"; } + $arr = false; $k = str_replace("msgid ", "", $l); if ($k != '""') {