Commit 61b0d882 by Carsten Brandt

support integer number type in fallback message formatter

parent 4d036999
...@@ -289,7 +289,6 @@ class MessageFormatter extends Component ...@@ -289,7 +289,6 @@ class MessageFormatter extends Component
$type = isset($token[1]) ? trim($token[1]) : 'none'; $type = isset($token[1]) ? trim($token[1]) : 'none';
switch($type) switch($type)
{ {
case 'number':
case 'date': case 'date':
case 'time': case 'time':
case 'spellout': case 'spellout':
...@@ -298,6 +297,11 @@ class MessageFormatter extends Component ...@@ -298,6 +297,11 @@ class MessageFormatter extends Component
case 'choice': case 'choice':
case 'selectordinal': case 'selectordinal':
throw new NotSupportedException("Message format '$type' is not supported. You have to install PHP intl extension to use this feature."); throw new NotSupportedException("Message format '$type' is not supported. You have to install PHP intl extension to use this feature.");
case 'number':
if (is_int($arg) && (!isset($token[2]) || trim($token[2]) == 'integer')) {
return $arg;
}
throw new NotSupportedException("Message format 'number' is only supported for integer values. You have to install PHP intl extension to use this feature.");
case 'none': return $arg; case 'none': return $arg;
case 'select': case 'select':
/* http://icu-project.org/apiref/icu4c/classicu_1_1SelectFormat.html /* http://icu-project.org/apiref/icu4c/classicu_1_1SelectFormat.html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment