Skip to content

Commit

Permalink
MAGETWO-47439: [Github] i18n:collect-phrases -m can't find many impor…
Browse files Browse the repository at this point in the history
…tant magento phrases #2630

- Revised regex.
  • Loading branch information
Hayder Sharhan committed Jan 28, 2016
1 parent 9d28e36 commit 81d6668
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"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"
"string with escaped \'single quotes\'","string with escaped \'single quotes\'"
"string with placeholder in escaped single quotes \'%1\'","string with placeholder in escaped single quotes \'%1\'"
"string with \"double quotes\"","string with \"double quotes\""
"string with placeholder in double quotes \"%1\"","string with placeholder in double quotes \"%1\""
"string with \'single quotes\'","string with \'single quotes\'"
"string with placeholder in single quotes \'%1\'","string with placeholder in single quotes \'%1\'"
"string with ""double quotes""","string with ""double quotes"""
"string with placeholder in double quotes ""%1""","string with placeholder in double quotes ""%1"""
"string with 'single quotes'","string with 'single quotes'"
"string with placeholder in single quotes '%1'","string with placeholder in single quotes '%1'"
"string with escaped \"double quotes\"","string with escaped \"double quotes\""
"string with placeholder in escaped double quotes \"%1\"","string with placeholder in escaped double quotes \"%1\""
2 changes: 1 addition & 1 deletion setup/src/Magento/Setup/Module/I18n/Dictionary/Phrase.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private function getCompiledString($string)
{
$encloseQuote = $this->getQuote() == Phrase::QUOTE_DOUBLE ? Phrase::QUOTE_DOUBLE : Phrase::QUOTE_SINGLE;
//find all occurrences of ' and ", with no \ before it.
preg_match_all('/[^\\\\][\'"]|[\'\"][^\\\\]/', $string, $matches);
preg_match_all('/[^\\\\]' . $encloseQuote . '|' . $encloseQuote . '[^\\\\]/', $string, $matches);
if (count($matches[0])) {
$string = preg_replace('/([^\\\\])' . $encloseQuote . ' ?\. ?' . $encloseQuote . '/', '$1', $string);
$string = addslashes($string);
Expand Down

0 comments on commit 81d6668

Please sign in to comment.