old_contents: import Ember from "ember";
  import translations from "croodle/lang/translations";
  /* global App */
  
  export default Ember.View.extend({
    templateName: 'language-switch',
    
    languages: function() {
      var languages = [];
      for(var lang in translations) {
        languages.push(lang);
      }
      return languages;
    }.property(),
    
    languageChanged: function() {
      // change language
      var language = this.get('controller.language.selected');
      
      // save language in cookie
      document.cookie="language=" + language + ";" +
              // give it an lifetime of one year
              "max-age=" + 60*60*24*356 + ";";
      
      // rerender page
      App.reset();
    }.observes('controller.language.selected')
  });
  
new_contents: import Ember from "ember";
  import translations from "croodle/lang/translations";
  
  export default Ember.View.extend({
    templateName: 'language-switch',
    
    languages: function() {
      var languages = [];
      for(var lang in translations) {
        languages.push(lang);
      }
      return languages;
    }.property(),
    
    languageChanged: function() {
      // change language
      var language = this.get('controller.language.selected');
      
      // save language in cookie
      document.cookie="language=" + language + ";" +
              // give it an lifetime of one year
              "max-age=" + 60*60*24*356 + ";";
      
      // rerender page
      Croodle.reset();
    }.observes('controller.language.selected')
  });
  
subject: fix namespace reference to own application