 $ = require 'jqueryify'
 translate = require 't7e'
 enUs = require '../translations/en_us'
+
+HTML = $(document.body.parentNode)
 
 DEFAULT = '$DEFAULT'
 


  constructor: ->
    preferredLanguage = localStorage.preferredLanguage || DEFAULT

    @el = $("<select class='#{@className}'></select>")



  onChange: ->
    preferredLanguage = @el.val()
    HTML.attr 'data-language', preferredLanguage

    localStorage.preferredLanguage = preferredLanguage

    if preferredLanguage is DEFAULT
