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 = ; const localesMyAppSupports = /* list locales here */; // Determine if the built-in `Intl` has the locale data we need.if ! // `Intl` exists, but it doesn't have the data we need, so load the // polyfill and replace the constructors we need with the polyfill's. ; ; // Load de ; ; // Load de