title: Ember: dynamic switch to chosen language (using i18n library)
body: <p>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 start all possible language dictionaries.  I thus want to load the dictionary dynamically when the user chooses to change language.  I have made a first implementation that works rather well. </p>
  
  <p>See <a href="http://jsfiddle.net/cyclomarc/RYbNG/7/" rel="nofollow noreferrer">http://jsfiddle.net/cyclomarc/RYbNG/7/</a></p>
  
  <p>When starting the app, it is rendered in english.  You can now select one of the views (About or Info) and these are also rendered in english.  When you click on 'Dutch', the dutch language dictionary is loaded and the application is redirected to the index route in the correct language.</p>
  
  <p>It seems that the new language strings are only used when you transition to a dummy route and then back to the route you want (in my sample this is always 'index').</p>
  
  <pre><code>updateLanguage: function (lang) {
      var _self = this;
      //Load correct dictionary and transition to index route
      $.getScript("http://libraries.azurewebsites.net/locales/dictionary_" + lang + ".js", function () {
        CLDR.defaultLanguage = lang;
        _self.transitionToRoute('I18redirect');
      });
    }
  
  App.I18redirectRoute = Ember.Route.extend({
    activate: function () {
      this.transitionTo('index');
    }
  });
  </code></pre>
  
  <p><strong>My questions:</strong></p>
  
  <ol>
  <li><p>Is this the best way to reload a view.template (transition to dummy route and then on activate transition to index) ?</p></li>
  <li><p>Is there a way to transition back to the route where you requested the language change (would need to use something with get(path) or so ) ?</p></li>
  <li><p>I would also like to translate the strings 'outside' the red div (the application outlet).  I transition back to index, but in that case, the application template is not redrawn ... What could be the reason ? </p></li>
  <li><p>Is it the expected behaviour that when you move away from a template and then re-enter the template, the template itself is rebuild with all the language strings, or is this only when in the meantime the language is changed ? How could such a rebuild of template with new strings be traced in console log ?</p></li>
  </ol>
  
  <p>Any other ideas to make this a robust switching solution ? </p>