Sha256: 81f06d1ef7741a4e483b6d537dc80adaed5f6755f19100a55f5bb6d9c4ab46c4

Contents?: true

Size: 530 Bytes

Versions: 25

Compression:

Stored size: 530 Bytes

Contents

module Spree
  class LocaleController < BaseController
    def set
      if request.referer && request.referer.starts_with?('http://' + request.host)
        session['user_return_to'] = request.referer
      end
      if params[:locale] && I18n.available_locales.include?(params[:locale].to_sym)
        session[:locale] = I18n.locale = params[:locale].to_sym
        flash.notice = t(:locale_changed)
      else
        flash[:error] = t(:locale_not_changed)
      end
      redirect_back_or_default(root_path)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
spree_core-1.1.6 app/controllers/spree/locale_controller.rb
spree_core-1.1.5 app/controllers/spree/locale_controller.rb
spree_core-1.2.3 app/controllers/spree/locale_controller.rb
spree_core-1.2.2 app/controllers/spree/locale_controller.rb
spree_core-1.1.4 app/controllers/spree/locale_controller.rb
spree_core-1.2.0 app/controllers/spree/locale_controller.rb
spree_core-1.2.0.rc2 app/controllers/spree/locale_controller.rb
spree_core-1.2.0.rc1 app/controllers/spree/locale_controller.rb
spree_core-1.1.3 app/controllers/spree/locale_controller.rb
spree_core-1.0.6 app/controllers/spree/locale_controller.rb
spree_core-1.1.2 app/controllers/spree/locale_controller.rb
spree_core-1.1.2.rc1 app/controllers/spree/locale_controller.rb
spree_core-1.1.1 app/controllers/spree/locale_controller.rb
spree_core-1.1.0 app/controllers/spree/locale_controller.rb
spree_core-1.0.4 app/controllers/spree/locale_controller.rb
spree_core-1.1.0.rc2 app/controllers/spree/locale_controller.rb
spree_core-1.1.0.rc1 app/controllers/spree/locale_controller.rb
spree_core-1.0.3 app/controllers/spree/locale_controller.rb
spree_core-1.0.2 app/controllers/spree/locale_controller.rb
spree_core-1.0.1 app/controllers/spree/locale_controller.rb