Skip to content

Commit

Permalink
merged branch aggressivex/translation-pcre-patch (PR #2047)
Browse files Browse the repository at this point in the history
Commits
-------

723cb71 [Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

Discussion
----------

[Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

[Translation] Add compatibility to PCRE 6.6.0 for explicit interval pluralization

Corrected branches: From 2.0 to 2.0

more info: #2038
  • Loading branch information
fabpot committed Aug 28, 2011
2 parents 07bdb8a + 723cb71 commit 8497f5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Component/Translation/Interval.php
Expand Up @@ -80,13 +80,13 @@ static public function getIntervalRegexp()
|
(?<left_delimiter>[\[\]])
(?P<left_delimiter>[\[\]])
\s*
(?<left>-Inf|\-?\d+)
(?P<left>-Inf|\-?\d+)
\s*,\s*
(?<right>\+?Inf|\-?\d+)
(?P<right>\+?Inf|\-?\d+)
\s*
(?<right_delimiter>[\[\]])
(?P<right_delimiter>[\[\]])
EOF;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Translation/MessageSelector.php
Expand Up @@ -54,7 +54,7 @@ public function choose($message, $number, $locale)
foreach ($parts as $part) {
$part = trim($part);

if (preg_match('/^(?<interval>'.Interval::getIntervalRegexp().')\s+(?<message>.+?)$/x', $part, $matches)) {
if (preg_match('/^(?P<interval>'.Interval::getIntervalRegexp().')\s+(?P<message>.+?)$/x', $part, $matches)) {
$explicitRules[$matches['interval']] = $matches['message'];
} elseif (preg_match('/^\w+\: +(.+)$/', $part, $matches)) {
$standardRules[] = $matches[1];
Expand Down

0 comments on commit 8497f5f

Please sign in to comment.