Fix formatting in Console\PoToPhp

This commit is contained in:
Hypolite Petovan 2018-03-24 16:08:56 -04:00
parent 641bd5eaa6
commit 91eb644743

View File

@ -98,7 +98,7 @@ HELP;
$out .= '}}' . "\n"; $out .= '}}' . "\n";
} }
if ($k != "" && substr($l, 0, 7) == 'msgstr ') { if ($k != '' && substr($l, 0, 7) == 'msgstr ') {
if ($ink) { if ($ink) {
$ink = false; $ink = false;
$out .= '$a->strings["' . $k . '"] = '; $out .= '$a->strings["' . $k . '"] = ';
@ -114,6 +114,7 @@ HELP;
$inv = true; $inv = true;
} }
if ($k != "" && substr($l, 0, 7) == 'msgstr[') { if ($k != "" && substr($l, 0, 7) == 'msgstr[') {
if ($ink) { if ($ink) {
$ink = false; $ink = false;
@ -125,9 +126,10 @@ HELP;
} }
if (!$arr) { if (!$arr) {
$arr = True; $arr = true;
$out .= "[\n"; $out .= "[\n";
} }
$match = []; $match = [];
preg_match("|\[([0-9]*)\] (.*)|", $l, $match); preg_match("|\[([0-9]*)\] (.*)|", $l, $match);
$out .= "\t" $out .= "\t"
@ -152,9 +154,11 @@ HELP;
$inv = false; $inv = false;
$out .= '"' . $v . '"'; $out .= '"' . $v . '"';
} }
if ($k != "") { if ($k != "") {
$out .= ($arr) ? "];\n" : ";\n"; $out .= ($arr) ? "];\n" : ";\n";
} }
$arr = false; $arr = false;
$k = str_replace("msgid ", "", $l); $k = str_replace("msgid ", "", $l);
if ($k != '""') { if ($k != '""') {