better whitespace handling by ./cli locale:compare

This commit is contained in:
Andrew Engelbrecht 2018-04-29 23:37:18 -04:00 committed by Frédéric Guillot
parent f3ed96f161
commit e8df859da2
1 changed files with 2 additions and 2 deletions

View File

@ -63,11 +63,11 @@ class LocaleComparatorCommand extends BaseCommand
$content = file_get_contents($filename);
$strings = array();
if (preg_match_all('/\b[et]\((\'\K.*?\') *[\)\,]/', $content, $matches) && isset($matches[1])) {
if (preg_match_all('/\b[et]\s*\(\s*(\'\K.*?\')\s*[\)\,]/', $content, $matches) && isset($matches[1])) {
$strings = $matches[1];
}
if (preg_match_all('/\bdt\((\'\K.*?\') *[\)\,]/', $content, $matches) && isset($matches[1])) {
if (preg_match_all('/\bdt\s*\(\s*(\'\K.*?\')\s*[\)\,]/', $content, $matches) && isset($matches[1])) {
$strings = array_merge($strings, $matches[1]);
}