ember-intl
Notable Features
💵 Locale-aware numbers. Formatting of currencies, decimals, and percentages📅 Locale-aware dates and times formatting🕑 Locale-aware display of relative time. i.e,"in 1 day"
,"2 years ago"
, etc.💬 ICU Message Syntax. Pluralization and formatted segments (numbers, datetime, etc.)🌐 Support for 150+ languages- 🕵🏻 Translation linting (detects missing translations & translation argument mismatches)
📜 Built largely on standards. ICU message syntax & Native Intl API⚡ Extensive Ember Service API and template helpers for formatting and translating🎉 Advanced addon support to provide translations to the host app
Documentation
Migrating from 4.x to 5.x
Notable Changes
- Polyfills have been removed entirely and with it the need to bundle the pluralization rules as they now come from the native
Intl.PluralRules
API - Translations are now placed in a fixed location when bundled, no longer need to traverse the private API
requirejs._eak_seen
to hydrate the service with translations Intl.MessageFormat
parser and compiler which changes how we escape text - making it more ICU-compliant
Breaking Changes
- Node 8 support dropped
Intl.RelativeTime
polyfill has been replaced with the native API which behaves entirely different than the previous older spec implementation (read about in the Migration Document)- Translations are now escaped differently (read about in the Migration Document)
- Removes
shortNumber
formatting in favor of now supported native implementation using the"notation"
property i.e.,
this.intl.formatNumber(1000, {
notation: "compact" ,
compactDisplay: "short"
}); // -> 1k
When you're ready to upgrade, head over to the Migration Document to read more in detail about what changed.
All of this will result in smaller bundles, faster build times, and less work done on app boot.
Migrating from ember-i18n
There's an ember-i18n-to-intl-migrator tool that is used to convert your translations files and application code to ember-intl.
If you have any questions or issues, please open in ember-i18n-to-intl-migrator/issues