php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #81184 ICU has no default value support
Submitted: 2021-06-21 09:59 UTC Modified: 2021-06-21 11:15 UTC
From: f dot hazard at sowapps dot com Assigned: cmb (profile)
Status: Duplicate Package: intl (PECL)
PHP Version: 7.4.20 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: f dot hazard at sowapps dot com
New email:
PHP Version: OS:

 

 [2021-06-21 09:59 UTC] f dot hazard at sowapps dot com
Description:
------------
---
From manual page: https://php.net/messageformatter.formatmessage
---
For now, there is now way to define a default value. Please consider adding a way to specify the default value of a variable in pattern string.



Test script:
---------------
<?php
echo msgfmt_format_message('fr_FR', '{distance, plural, =0{Here}other{# km}undefined{No distance}}', []);
?>

Expected result:
----------------
Show "No distance" for example

Actual result:
--------------
{distance}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-06-21 11:15 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Package: *Languages/Translation +Package: intl -Assigned To: +Assigned To: cmb
 [2021-06-21 11:15 UTC] cmb@php.net
Duplicate of request #79219.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Sep 23 12:03:37 2021 UTC