ID:               50808
 Updated by:       [email protected]
 Reported By:      bschussek at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         I18N and L10N related
 Operating System: Linux Ubuntu 9.10
 PHP Version:      5.3.1
 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------

[2010-01-20 19:47:55] bschussek at gmail dot com

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 this bug report at http://bugs.php.net/?id=50808&edit=1

Reply via email to