Migration from v2 to v3
baseLocalewas removed fromconfig/ember-intl.jsformat-html-messagewas removed in favor of passinghtmlSafe=trueinto thet&format-messageAPI.
hbs
{{t "app.sale_begins" day=this.day htmlSafe=true}}
{{format-html-message
"Sale begins {day, date, shortWeekDay}"
day=this.day
htmlSafe=true
}}ember-intl-dot-notationis no longer needed. Deleteapp/models/ember-intl-translation.js. Your application should continue to behave the same whether your keys are flat or nested objects.intl.addTranslationwas removed in favor of usingintl.addTranslations.addTranslationstakes a locale as the first argument and a object as the second.
Example:
js
intl.addTranslations('en-us', {
hero: 'Welcome to ember-intl 3.0'
});fallbackwas removed in favor ofdefaults. This is for better alignment with ember-i18n's API.
hbs
{{t "app.sale_begins" day=this.day fallback="Sale begins {day, date, shortWeekDay}"}}becomes
js
intl.addTranslations('en-us', {
home: {
sale_begins: 'Sale begins {day, date, shortWeekDay}'
}
});hbs
{{t "app.sale_begins" day=this.day defaults="home.sale_begins"}}