intl-locales-supported
Utility to help you determine if your runtime has modern Intl API & locales support. This specifically checks for Intl.NumberFormat
, Intl.PluralRules
& Intl.RelativeTimeFormat
and is being used by react-intl
.
Usage
const areIntlLocalesSupported = require('intl-locales-supported');
const localesMyAppSupports = [
];
if (
!areIntlLocalesSupported(localesMyAppSupports, [
Intl.PluralRules,
Intl.RelativeTimeFormat,
])
) {
require('@formatjs/intl-pluralrules/polyfill');
require('@formatjs/intl-pluralrules/dist/locale-data/de');
require('@formatjs/intl-relativetimeformat/polyfill');
require('@formatjs/intl-relativetimeformat/dist/locale-data/de');
}