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')
});

@@ -77,25 +77,8 @@
 ns%22;
-%0A/* global App */
 %0A%0Aex
@@ -638,11 +638,15 @@
     
-App
+Croodle
 .res

fix namespace reference to own application