-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locale\Format throws away country part, results in wrong number format for Switzerland #5073
Comments
To allow us research the issue, please, provide description according to the template. |
@andimov |
Fine! It turns out, the
|
We have the same annoying issue and created a hack, just an around Plugin: We're running M 2.1.0 |
@ktruehl |
problem still present in 2.1.1 |
Confirmed, still exists in 2.1.1. Is there any timeline for a fix? |
This issue is still present in 2.1.4 |
This issue is still exist in 2.1.5 |
IMHO: There will be no fix at all for the 2.1 branch. It might be fixed in 2.2 as many other things. |
Fixed issues: - MAGETWO-57995 [GITHUB] Simple product videos display the thumbnail image rather than the embedded video player. #6360 - MAGETWO-57070 [GitHub] Locale\Format throws away country part, results in wrong number format #5073 - MAGETWO-69854 Can't set allowed or default currencies using config:set command - MAGETWO-66627 [GitHub] Default Post Code is applied for all Order's addresses if zip is not required - MAGETWO-66906 Deprecate setup:store-config:set command - MAGETWO-67274 Can't set value using config:set on uninstalled instance - MAGETWO-70294 [GitHub] Mass Actions with Childs don't work in CMS #9854 - MAGETWO-70216 Remove section i18n from shared file (config.php) - MAGETWO-59514 Hard coded "tax_region_id" in the \Magento\Tax\Setup\InstallData
@ktruehl, thank you for your report. |
In
Magento\Framework\Locale\Format
thegetPriceFormat()
method calls onDataBundle
to return theResourceBundle
for a given locale. InResourceBundle
theget()
method calls thecleanLocale()
method with the given locale as parameter. ThecleanLocale()
method throws away the country part. This results in wrongly formated numbers for countries who share languages but not the number format with other major countries, such as Switzerland. The localede_CH
gets shortened tode
. For the localede
the countryDE
(Germany) is implied. In Germany prices are formated as#.##0,00
, whereas in the German-speaking part of Switzerland prices are formated as#,##0.00
.The country part is there for a reason! I had to stupidly patch the
cleanLocale()
method in theResourceBundle
class to check for Swiss locales, since I have no clue why thecleanLocale()
method is there in the first place. Maybe there is a good reason, but I don't have the time to find out.The text was updated successfully, but these errors were encountered: