App.ButtonLanguageSwitcherComponent = Ember.Component.extend
  tagName: 'a'
  layoutName: 'components/language-switcher-button'
  classNameBindings: ['isCurrent:current']
  classNames: ['language-switch-button']
  isCurrent: Ember.computed 'locale', 'globals.locale', ->
    @get('locale') is @get('globals.locale')
  #isCurrent: Ember.computed.equal 'locale', 'globals.locale'
  click: -> @get('controller').send 'switchTo', @get('locale')
  action: 'switchTo'
  #TODO: EASY BUBBLE ACTION
  actions:
    switchTo: (locale)->
      setLocale locale
      @set 'globals.locale', locale
      @store.peekAll("page").invoke 'reload'
