Description
In Magento\Framework\Locale\Format
the getPriceFormat()
method calls on DataBundle
to return the ResourceBundle
for a given locale. In ResourceBundle
the get()
method calls the cleanLocale()
method with the given locale as parameter. The cleanLocale()
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 locale de_CH
gets shortened to de
. For the locale de
the country DE
(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 the ResourceBundle
class to check for Swiss locales, since I have no clue why the cleanLocale()
method is there in the first place. Maybe there is a good reason, but I don't have the time to find out.