Sha256: dc795b23ac2d95a8e1f60a9d92656464ade96807179e1ce8ae2076fbe2bd29dd

Contents?: true

Size: 538 Bytes

Versions: 5

Compression:

Stored size: 538 Bytes

Contents

module Spree
  class LocaleController < Spree::StoreController
    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

5 entries across 5 versions & 2 rubygems

Version Path
spree_core-1.3.1 app/controllers/spree/locale_controller.rb
spree_core-1.3.0 app/controllers/spree/locale_controller.rb
spree_core-1.3.0.rc2 app/controllers/spree/locale_controller.rb
dup_spree_core-1.3.0.rc1 app/controllers/spree/locale_controller.rb
spree_core-1.3.0.rc1 app/controllers/spree/locale_controller.rb