vitch / ember-intl

Localization library for any Ember Application or Addon

Home Page:https://ember-intl.github.io/ember-intl/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ember-intl

npm Version Ember Version Build Status npm Ember Observer Score

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

5.x

4.x (legacy)

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 updated which changes how text and tags are escaped

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

About

Localization library for any Ember Application or Addon

https://ember-intl.github.io/ember-intl/

License:MIT License


Languages

Language:JavaScript 95.9%Language:HTML 3.4%Language:CSS 0.7%