Sha256: 8eef7672bac7e021d84e5e9561faa11394684f4c6550d1ff93b3f5441f98478b

Contents?: true

Size: 455 Bytes

Versions: 14

Compression:

Stored size: 455 Bytes

Contents

Spree::BaseController.class_eval do
  before_filter :set_locale  #, :if => proc { !session[:locale] }

  protected

  def set_locale
    I18n.locale = extract_locale || I18n.default_locale
  end

  def extract_locale
    parsed_locale = (session[:zoned] && session[:zoned][:current_language]) || I18n.default_locale
    #I18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale  : nil
    parsed_locale ? parsed_locale.to_sym : nil
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
spree_zoned-0.5.38 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.37 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.36 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.35 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.34 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.33 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.32 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.31 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.30 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.29 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.28 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.27 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.26 app/controllers/spree/base_controller_decorator.rb
spree_zoned-0.5.25 app/controllers/spree/base_controller_decorator.rb