You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would find it nice if there was a way to format numbers according to the locale.
For instance, the number 1234.56 (as written in Javascript) should be rendered as 1,234.56 in English and 1 234,56 in French.
So it would be amazing if $.i18n('number-of-results', 1234.56) could render as There are 1,234.56 results in English and Il y a 1 234,56 résultats in French.
Apologies if this is already supported somehow, I couldn't figure it out looking at the readme.
Currently it is not supported in this library. Note that we are not planning to add any new features to jquery.i18n but banana.i18n - a jquery independent modern js library will be the replacement.
What you described would be a good addition, I agree. We at wikimedia has this number formatting feature as part of a mediawiki dependent localization library. But the the digit separator patterns are coming from mediawikibackend. It is a large set of CLDR originated patterns for all supported languages. To support that we may need to copy that data as part of library and incorporate parsing and number separator loigc.
I will create a copy of this issue in banana-i18n repo
I would find it nice if there was a way to format numbers according to the locale.
For instance, the number
1234.56
(as written in Javascript) should be rendered as1,234.56
in English and1 234,56
in French.So it would be amazing if
$.i18n('number-of-results', 1234.56)
could render asThere are 1,234.56 results
in English andIl y a 1 234,56 résultats
in French.Apologies if this is already supported somehow, I couldn't figure it out looking at the readme.
The standard function Number.prototype.toLocaleString can of course be used but this has two downsides:
The text was updated successfully, but these errors were encountered: