From e078caffd86feca160633778f884007acae6a9fa Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sun, 29 Jul 2018 14:20:01 +0200 Subject: Update php2po.php --- util/php2po.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/php2po.php') diff --git a/util/php2po.php b/util/php2po.php index 17feafa5d..a29ba7459 100644 --- a/util/php2po.php +++ b/util/php2po.php @@ -31,6 +31,7 @@ $ink = False; foreach ($infile as $l) { + $l = trim($l, " "); if (!preg_match("/^msgstr\[[1-9]/",$l)) { if ($k!="" && (substr($l,0,7)=="msgstr " || substr($l,0,8)=="msgstr[0")){ $ink = False; @@ -66,13 +67,13 @@ } if (substr($l,0,6)=="msgid ") { - preg_match('/^msgid "(.*)"/',$l,$m); + preg_match('/^msgid "(.*)"$/',$l,$m); $k = $m[1]; $ink = True; } if (substr($l,0,8)=="msgctxt ") { - preg_match('/^msgctxt "(.*)"/',$l,$m); + preg_match('/^msgctxt "(.*)"$/',$l,$m); $c = $m[1]; } -- cgit v1.2.3