improved unit tests for ICU message formatter

This commit is contained in:
Carsten Brandt
2013-10-16 05:54:10 +02:00
parent 150b9366fc
commit 2eb5abbfcb
2 changed files with 87 additions and 55 deletions

View File

@@ -15,6 +15,7 @@ namespace yii\i18n;
* substituted.
*
* @author Alexander Makarov <sam@rmcreative.ru>
* @author Carsten Brandt <mail@cebe.cc>
* @since 2.0
*/
class MessageFormatter extends \MessageFormatter
@@ -55,7 +56,7 @@ class MessageFormatter extends \MessageFormatter
}
/**
* Replace named placeholders with numeric placeholders.
* Replace named placeholders with numeric placeholders and quote unused.
*
* @param string $pattern The pattern string to replace things into.
* @param array $args The array of values to insert into the format string.
@@ -65,7 +66,7 @@ class MessageFormatter extends \MessageFormatter
{
$map = array_flip(array_keys($args));
// parsing pattern base on ICU grammar:
// parsing pattern based on ICU grammar:
// http://icu-project.org/apiref/icu4c/classMessageFormat.html#details
$parts = explode('{', $pattern);
$c = count($parts);