Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.10.6
-
Fix Version/s: 1.10.7
-
Component/s: Zend_Locale
-
Labels:None
Description
I've found one annoying thing, when using Zend_Currency, which requires whole language+region locale.
In my situation, when trying:
$currency = new Zend_Currency(array('value' => 12.34), new Zend_Locale());
$currency = new Zend_Currency(array('value' => 12.34));
...and using browser with:
Accept-Language: pl,en-us;q=0.7,en;q=0.3
pl has default 1.0 quality factor.
...and having:
Environment language pl_PL, pl
Default language en_US
I get that languages returned:
browser array(3) { ["pl"] => float(1) ["en_US"] => float(0.7) ["en"] => float(0.7) }
environment array(2) { ["pl_PL"] => int(1) ["pl"] => int(1) }
default array(1) { ["en"] => bool(true) }
auto array(4) { ["pl"] => float(1) ["en_US"] => float(0.7) ["en"] => float(0.7) ["pl_PL"] => int(1) }
Issue:
When it comes to choose, 'pl' is returned as locale, which disallows directly using Zend_Currency().
Solution (request):
When there are two languages with the same, highest quality factor, return more detailed one.
General idea:
When language has only one region (it's not only Poland, there are more countries/locales like this) there should be returned more detailed locale string ('pl_PL' instead of 'pl', 'lv_LV' <= 'lv').
Locale Upgrading is another issue which is already worked on.