Skip to content

Commit 2f96d82

Browse files
authored
Merge pull request #274 from apeleteiro/patch-1
Fix at fixMultiLines
2 parents ef2e312 + f9832ed commit 2f96d82

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

src/Extractors/Po.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,19 @@ public static function fromString($string, Translations $translations, array $op
162162
protected static function fixMultiLines($line, array $lines, &$i)
163163
{
164164
for ($j = $i, $t = count($lines); $j < $t; ++$j) {
165-
if (substr($line, -1, 1) == '"'
166-
&& isset($lines[$j + 1])
167-
&& substr(trim($lines[$j + 1]), 0, 1) == '"'
168-
) {
169-
$line = substr($line, 0, -1).substr(trim($lines[$j + 1]), 1);
170-
} else {
171-
$i = $j;
172-
break;
165+
if (substr($line, -1, 1) == '"' && isset($lines[$j + 1])) {
166+
$nextLine = trim($lines[$j + 1]);
167+
if (substr($nextLine, 0, 1) == '"') {
168+
$line = substr($line, 0, -1).substr($nextLine, 1);
169+
continue;
170+
}
171+
if (substr($nextLine, 0, 4) == '#~ "') {
172+
$line = substr($line, 0, -1).substr($nextLine, 4);
173+
continue;
174+
}
173175
}
176+
$i = $j;
177+
break;
174178
}
175179

176180
return $line;

0 commit comments

Comments
 (0)