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