Reputation: 44331
What are the accepted practices in ember to build multilingual applications? What I would like to know is:
Upvotes: 4
Views: 1530
Reputation: 23322
You could roll your own if you need something special, but as a starting point this is what most people use at the moment: https://github.com/jamesarosen/ember-i18n
One of (my) favorite feature is clearly the TranslatteableProperties
mixin which is really easy to use:
Translate properties on any object: The Em.I18n.TranslateableProperties mixin automatically translates any property ending in "Translation":
var userButton = Em.Object.extend(Em.I18n.TranslateableProperties, {
labelTranslation: 'button.add_user.title'
});
userButton.get('label');
Check also this other answer of my: Ember: how to translate a placeholder using i18n lib? for reference.
Hope it helps.
Upvotes: 2