You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
James Alexander Rosen edited this page Jun 24, 2015
·
1 revision
Pluralization
Ember-i18n includes support for inflection based on a count interpolation. Pluralization rules are based on the Unicode Common Locale Data Repository.
Whenever you pass the count option to the t function, template will be pluralized:
// app/locales/en/translations.js:exportdefault{'dog': {'one': 'a dog','other': '{{count}} dogs'}};// Elsewhere:i18n.t('dog',{count: 1});// a dogi18n.t('dog',{count: 2});// 2 dogs
ember-i18n converts 1 to .one and 2 to .other. Depending on the locale, there could be up to 6 plural forms used: zero, one, two, few, many, other.
If you want to override the inflection rules for a locale, you can define your own in app/locales/[locale]/config.js. For example, to add support for zero to English: