From 4d036999075fb3cc4d48375506fa221adf1063c5 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 28 Oct 2013 12:09:26 +0100 Subject: [PATCH] fixed fallback message format parameter order --- framework/yii/i18n/MessageFormatter.php | 4 ++-- tests/unit/framework/i18n/FallbackMessageFormatterTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/yii/i18n/MessageFormatter.php b/framework/yii/i18n/MessageFormatter.php index d04782e..9754e0b 100644 --- a/framework/yii/i18n/MessageFormatter.php +++ b/framework/yii/i18n/MessageFormatter.php @@ -316,7 +316,7 @@ class MessageFormatter extends Component } } if ($message !== false) { - return $this->fallbackFormat($locale, $message, $args); + return $this->fallbackFormat($message, $args, $locale); } break; case 'plural': @@ -351,7 +351,7 @@ class MessageFormatter extends Component } } if ($message !== false) { - return $this->fallbackFormat($locale, $message, $args); + return $this->fallbackFormat($message, $args, $locale); } break; } diff --git a/tests/unit/framework/i18n/FallbackMessageFormatterTest.php b/tests/unit/framework/i18n/FallbackMessageFormatterTest.php index f674358..910c433 100644 --- a/tests/unit/framework/i18n/FallbackMessageFormatterTest.php +++ b/tests/unit/framework/i18n/FallbackMessageFormatterTest.php @@ -115,7 +115,7 @@ _MSG_ /** * @dataProvider patterns */ - public function testNamedArgumentsObject($pattern, $expected, $args) + public function testNamedArguments($pattern, $expected, $args) { $formatter = new FallbackMessageFormatter(); $result = $formatter->fallbackFormat($pattern, $args, 'en_US');