Sha256: 71a9cccbafcb4ecd93e75a7d1e2736a0cde2cde39856277fb03fd7bfaf685d49

Contents?: true

Size: 518 Bytes

Versions: 60

Compression:

Stored size: 518 Bytes

Contents

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

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
spree_frontend-4.0.9 app/controllers/spree/locale_controller.rb
spree_frontend-4.1.15 app/controllers/spree/locale_controller.rb
spree_frontend-4.1.14 app/controllers/spree/locale_controller.rb
spree_frontend-4.0.8 app/controllers/spree/locale_controller.rb
spree_frontend-3.7.14.1 app/controllers/spree/locale_controller.rb
spree_frontend-4.1.13.1 app/controllers/spree/locale_controller.rb
spree_frontend-4.0.7.1 app/controllers/spree/locale_controller.rb
spree_frontend-4.0.7 app/controllers/spree/locale_controller.rb
spree_frontend-3.7.14 app/controllers/spree/locale_controller.rb
spree_frontend-4.2.0.rc5 app/controllers/spree/locale_controller.rb
spree_frontend-4.2.0.rc4 app/controllers/spree/locale_controller.rb
spree_frontend-4.2.0.rc3 app/controllers/spree/locale_controller.rb
spree_frontend-4.1.13 app/controllers/spree/locale_controller.rb
spree_frontend-4.0.6 app/controllers/spree/locale_controller.rb
spree_frontend-4.2.0.rc2 app/controllers/spree/locale_controller.rb
spree_frontend-3.7.13 app/controllers/spree/locale_controller.rb
spree_frontend-4.0.5 app/controllers/spree/locale_controller.rb
spree_frontend-4.1.12 app/controllers/spree/locale_controller.rb
spree_frontend-3.7.12 app/controllers/spree/locale_controller.rb
spree_frontend-4.2.0.rc1 app/controllers/spree/locale_controller.rb