Browse Source

fixed fallback message format parameter order

tags/2.0.0-alpha
Carsten Brandt 11 years ago
parent
commit
4d03699907
  1. 4
      framework/yii/i18n/MessageFormatter.php
  2. 2
      tests/unit/framework/i18n/FallbackMessageFormatterTest.php

4
framework/yii/i18n/MessageFormatter.php

@ -316,7 +316,7 @@ class MessageFormatter extends Component
} }
} }
if ($message !== false) { if ($message !== false) {
return $this->fallbackFormat($locale, $message, $args); return $this->fallbackFormat($message, $args, $locale);
} }
break; break;
case 'plural': case 'plural':
@ -351,7 +351,7 @@ class MessageFormatter extends Component
} }
} }
if ($message !== false) { if ($message !== false) {
return $this->fallbackFormat($locale, $message, $args); return $this->fallbackFormat($message, $args, $locale);
} }
break; break;
} }

2
tests/unit/framework/i18n/FallbackMessageFormatterTest.php

@ -115,7 +115,7 @@ _MSG_
/** /**
* @dataProvider patterns * @dataProvider patterns
*/ */
public function testNamedArgumentsObject($pattern, $expected, $args) public function testNamedArguments($pattern, $expected, $args)
{ {
$formatter = new FallbackMessageFormatter(); $formatter = new FallbackMessageFormatter();
$result = $formatter->fallbackFormat($pattern, $args, 'en_US'); $result = $formatter->fallbackFormat($pattern, $args, 'en_US');

Loading…
Cancel
Save