Open alexcroox opened 4 years ago
I've just done some more digging, Intl: NumberFormat: formatToParts has no pollyfills. So this library won't work with IE11 or iOS 11 or iOS 12 if you want to use i18n-n
https://caniuse.com/#feat=mdn-javascript_builtins_intl_numberformat_formattoparts
Oops...
IE11 is one of supported browser of vue-i18n (ref. #843, #844), so this is definitely bug.
formatter.formatToParts
should be replaced with polyfill.
I don't believe there is one for formatToParts.
According to MDN, a github repository https://github.com/tc39/proposal-intl-formatToParts provides polyfill for formatToParts
.
PRs are welcome.
Sorry I wasn't clear, see this issue from that repo: https://github.com/tc39/proposal-intl-formatToParts/issues/4
Current polyfill contains only Intl.DateTimeFormat.prototype.formatToParts but not Intl.NumberFormat.prototype.formatToParts
vue & vue-i18n version
"vue-i18n": "^8.18.1", "vue": "^2.6.11",
Older browsers such as Chrome 50 are erroring with:
TypeError: formatter.formatToParts is not a function
Which relates to
VueI18n.prototype._ntp
Is there anything specific I can do to pollyfill this? I've tried adding:
transpileDependencies: ['vue-i18n']
with no joy