#50808 [NEW]: MessageFormatter buggy when using choice formats with nested parameters
From: bschussek at gmail dot com
Operating system: Linux Ubuntu 9.10
PHP version: 5.3.1
PHP Bug Type: I18N and L10N related
Bug description: MessageFormatter buggy when using choice formats with nested parameters
Description:
------------
When a message formatter formats choices with nested variables, its
behaviour is buggy.
Interestingly, the code below works if you insert the parameter "{1}" once
more outside of the choice:
'There are {0,choice,0#are no {1} files|1#is one {1} file} ok {1}'
produces
There are are no text files ok text
There are is one image file ok image
Reproduce code:
---------------
$fmt = MessageFormatter::create('en_GB', 'There are {0,choice,0#are no {1}
files|1#is one {1} file} ok');
echo $fmt->format(array(0, "text")), "\n";
echo $fmt->format(array(1, "image")), "\n";
Expected result:
----------------
There are are no text files ok
There are is one image file ok
Actual result:
--------------
There are are no {1} files ok
There are is one {1} file ok
--
Edit bug report at http://bugs.php.net/?id=50808&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50808&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50808&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50808&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50808&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50808&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50808&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50808&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50808&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50808&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50808&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50808&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50808&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50808&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50808&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50808&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50808&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50808&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50808&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50808&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50808&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50808&r=mysqlcfg
Thread (8 messages)
- bschussek at gmail dot com