Sha256: 85d02039212bd2eaba4bcc0f0adc9aef152fae865e8f4e3d103eb8fa94d75551

Contents?: true

Size: 492 Bytes

Versions: 34

Compression:

Stored size: 492 Bytes

Contents

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

Version data entries

34 entries across 34 versions & 6 rubygems

Version Path
spree_core-0.70.7 app/controllers/locale_controller.rb
spree_core-0.70.6 app/controllers/locale_controller.rb
apispree_core-0.0.0 app/controllers/locale_controller.rb
My-Commerce_core-1.1.0 app/controllers/locale_controller.rb
My-Commerce_core-1.0.0 app/controllers/locale_controller.rb
MyCommerceapi-1.0.0 core/app/controllers/locale_controller.rb
MyCommerce-0.0.3 core/app/controllers/locale_controller.rb
rfcommerce_core-0.0.3 app/controllers/locale_controller.rb
spree_core-0.60.6 app/controllers/locale_controller.rb
spree_core-0.70.5 app/controllers/locale_controller.rb
spree_core-0.70.4 app/controllers/locale_controller.rb
spree_core-0.60.5 app/controllers/locale_controller.rb
spree_core-0.70.3 app/controllers/locale_controller.rb
spree_core-0.70.2 app/controllers/locale_controller.rb
spree_core-0.40.4 app/controllers/locale_controller.rb
spree_core-0.50.4 app/controllers/locale_controller.rb
spree_core-0.60.4 app/controllers/locale_controller.rb
spree_core-0.50.3 app/controllers/locale_controller.rb
spree_core-0.60.3 app/controllers/locale_controller.rb
spree_core-0.70.1 app/controllers/locale_controller.rb