Sha256: 897694281333f873796b948c0c967bc6b0364c09d8ea8b8af69f6cc7de3dea41
Contents?: true
Size: 542 Bytes
Versions: 3
Compression:
Stored size: 542 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.map(&:to_s).include?(params[:locale]) session[:locale] = I18n.locale = params[:locale] flash.notice = t(:locale_changed) else flash[:error] = t(:locale_not_changed) end redirect_back_or_default(spree.root_path) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
spree_core-1.3.5 | app/controllers/spree/locale_controller.rb |
spree_core-1.3.4 | app/controllers/spree/locale_controller.rb |
spree_core-1.3.3 | app/controllers/spree/locale_controller.rb |