Skip to content

Commit 81d6668

Browse files
author
Hayder Sharhan
committed
MAGETWO-47439: [Github] i18n:collect-phrases -m can't find many important magento phrases #2630
- Revised regex.
1 parent 9d28e36 commit 81d6668

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dev/tests/integration/testsuite/Magento/Setup/Console/Command/_files/expectedPhrases.csv

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"first part of concat second part third part with two placeholders %1, %2","first part of concat second part third part with two placeholders %1, %2"
1212
"string with escaped \'single quotes\'","string with escaped \'single quotes\'"
1313
"string with placeholder in escaped single quotes \'%1\'","string with placeholder in escaped single quotes \'%1\'"
14-
"string with \"double quotes\"","string with \"double quotes\""
15-
"string with placeholder in double quotes \"%1\"","string with placeholder in double quotes \"%1\""
16-
"string with \'single quotes\'","string with \'single quotes\'"
17-
"string with placeholder in single quotes \'%1\'","string with placeholder in single quotes \'%1\'"
14+
"string with ""double quotes""","string with ""double quotes"""
15+
"string with placeholder in double quotes ""%1""","string with placeholder in double quotes ""%1"""
16+
"string with 'single quotes'","string with 'single quotes'"
17+
"string with placeholder in single quotes '%1'","string with placeholder in single quotes '%1'"
1818
"string with escaped \"double quotes\"","string with escaped \"double quotes\""
1919
"string with placeholder in escaped double quotes \"%1\"","string with placeholder in escaped double quotes \"%1\""

setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ private function getCompiledString($string)
270270
{
271271
$encloseQuote = $this->getQuote() == Phrase::QUOTE_DOUBLE ? Phrase::QUOTE_DOUBLE : Phrase::QUOTE_SINGLE;
272272
//find all occurrences of ' and ", with no \ before it.
273-
preg_match_all('/[^\\\\][\'"]|[\'\"][^\\\\]/', $string, $matches);
273+
preg_match_all('/[^\\\\]' . $encloseQuote . '|' . $encloseQuote . '[^\\\\]/', $string, $matches);
274274
if (count($matches[0])) {
275275
$string = preg_replace('/([^\\\\])' . $encloseQuote . ' ?\. ?' . $encloseQuote . '/', '$1', $string);
276276
$string = addslashes($string);

0 commit comments

Comments
 (0)