Polyfills
ember-intl relies on the following APIs from Intl. The links on the left column provide browser compatibility.
How to Polyfill
TIP
A more advanced strategy, such as dynamically importing assets or dynamically injecting a script based on the browser requesting the page, is recommended for production apps.
Covering such strategies is out of scope for this documentation. For more information, see the individual polyfill links in https://formatjs.github.io/docs/polyfills.
Intl.getCanonicalLocales()
sh
pnpm add -D @formatjs/intl-getcanonicallocalests
// app/app.ts
import '@formatjs/intl-getcanonicallocales/polyfill.js';Intl.Locale
sh
pnpm add -D @formatjs/intl-localets
// app/app.ts
import '@formatjs/intl-locale/polyfill.js';Intl.PluralRules
Prerequisites: Intl.getCanonicalLocales() and Intl.Locale.
sh
pnpm add -D @formatjs/intl-pluralrulests
// app/app.ts
import '@formatjs/intl-pluralrules/polyfill.js';
import '@formatjs/intl-pluralrules/locale-data/de.js';
import '@formatjs/intl-pluralrules/locale-data/en.js';
import '@formatjs/intl-pluralrules/locale-data/es.js';
import '@formatjs/intl-pluralrules/locale-data/fr.js'; // etc.Intl.RelativeTimeFormat
Prerequisites: Intl.getCanonicalLocales(), Intl.Locale, and Intl.PluralRules.
sh
pnpm add -D @formatjs/intl-relativetimeformatts
// app/app.ts
import '@formatjs/intl-relativetimeformat/polyfill.js';
import '@formatjs/intl-relativetimeformat/locale-data/de.js';
import '@formatjs/intl-relativetimeformat/locale-data/en.js';
import '@formatjs/intl-relativetimeformat/locale-data/es.js';
import '@formatjs/intl-relativetimeformat/locale-data/fr.js'; // etc.