I am using the ember-i18n library for translation of static strings used throughout my application. As the language files are rather big, I do not want to load at application st
You could utilize rerender() method of the view, this way you won't have to switch to a dummy url:
updateLanguage: function(lang) {
//Send xhr to get a dictionary for corresponding language
this.getDictionary(lang).then(successCb, failureCb);
//If dictionary was retrieved, set translations property and
function successCb(response) {
Ember.I18n.translations = response;
$.each(Ember.View.views, function(index, view) {
view.rerender();
});
};
function failureCb(response) {
console.error('Dictionary for this language is not available');
};
}