I am trying to understand how to internationalize a web-app developed with emberjs.
I found the ember-i18n package that I think is a good solution, but I can't understand how to use it.
I am trying to understand how to internationalize a web-app developed with emberjs.
I found the ember-i18n package that I think is a good solution, but I can't understand how to use it.
Share Improve this question edited Jan 16, 2013 at 6:30 Zak 7,0776 gold badges38 silver badges54 bronze badges asked Mar 24, 2012 at 10:33 RedBassRedBass 3282 silver badges12 bronze badges1 Answer
Reset to default 7The first thing you'll need to do is to create hash with all your localizations, you always pair up a identifier with the localized string.
The best practice here is to create a put all locales you have into a seperate file. (like loc-english.js)
Em.I18n.translations = {
'login.loginbutton': 'Login',
};
When your webapp is getting loaded, make sure you load your strings file. All string must be loaded before you render the first view with ember.
The actual use is quite simple you just use the 't' helper in your template
<button class="login">{{t login.loginbutton}}</button>
Which will result in Login
You can find more information at: https://github./zendesk/ember-i18n/blob/master/README.md