1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00
This commit is contained in:
Tyde
2021-12-30 14:44:54 -05:00
committed by Ryan Cramer
parent da43be7d12
commit bca50abb48

View File

@@ -228,7 +228,7 @@ class LanguageParser extends Wire {
// Find __('text', textdomain) style matches
preg_match_all(
'/([\s.=(\\\\]__|^__)\(\s*' . // __(
'/([\s.=(\\\\,]__|=>__|^__)\(\s*' . // __(
'([\'"])(.+?)(?<!\\\\)\\2\s*' . // "text"
'(?:,\s*[^)]+)?\)+(.*)$/m', // , textdomain (optional) and everything else
$data, $matches[2]
@@ -236,7 +236,7 @@ class LanguageParser extends Wire {
// Find _x('text', 'context', textdomain) or $this->_x('text', 'context') style matches
preg_match_all(
'/([\s.=>(\\\\]_x|^_x)\(\s*' . // _x( or $this->_x(
'/([\s.=>(\\\\,]_x|^_x)\(\s*' . // _x( or $this->_x(
'([\'"])(.+?)(?<!\\\\)\\2\s*,\s*' . // "text",
'([\'"])(.+?)(?<!\\\\)\\4\s*' . // "context"
'[^)]*\)+(.*)$/m', // , textdomain (optional) and everything else
@@ -245,7 +245,7 @@ class LanguageParser extends Wire {
// Find _n('singular text', 'plural text', $cnt, textdomain) or $this->_n(...) style matches
preg_match_all(
'/([\s.=>(\\\\]_n|^_n)\(\s*' . // _n( or $this->_n(
'/([\s.=>(\\\\,]_n|^_n)\(\s*' . // _n( or $this->_n(
'([\'"])(.+?)(?<!\\\\)\\2\s*,\s*' . // "singular",
'([\'"])(.+?)(?<!\\\\)\\4\s*,\s*' . // "plural",
'.+?\)+(.*)$/m', // $count, optional textdomain, closing function parenthesis ) and rest of line