php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65627 Support select for MessageFormatter
Submitted: 2013-09-06 01:10 UTC Modified: 2013-10-16 23:28 UTC
Votes:5
Avg. Score:3.8 ± 1.0
Reproduced:2 of 5 (40.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: f21 dot groups at gmail dot com Assigned:
Status: Closed Package: intl (PECL)
PHP Version: 5.5.3 OS: Ubuntu 13.04 64-bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 9 = ?
Subscribe to this entry?

 
 [2013-09-06 01:10 UTC] f21 dot groups at gmail dot com
Description:
------------
The choice conditional selector has been deprecated in ICU.

Instead, it is now recommended to use select, which does not seem to be supported.

$fmt = new MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}");

var_dump($fmt); //null


Test script:
---------------
<?php

$fmt = new MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}");

var_dump($fmt); //null


Expected result:
----------------
$fmt should not be null and should work propertly.

Actual result:
--------------
$fmt is null

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-16 21:19 UTC] sam at rmcreative dot ru
Select format is definitely supported. I've copy-pasted your code and it works just fine with 5.3, 5.4 and 5.5.

$fmt = new \MessageFormatter("fr_FR", "{0} est {1, select, female {allée} other {allé}}");
echo $fmt->format(array('Eugenia', 'female'));

// result is 'Eugenia est allée'

I guess the issue is that pattern should be in UTF-8 and you're using something else.
 [2013-10-16 23:28 UTC] f21 dot groups at gmail dot com
-Status: Open +Status: Closed
 [2013-10-16 23:28 UTC] f21 dot groups at gmail dot com
You are right!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Nov 25 09:01:23 2020 UTC