Sha256: da8c8a43407423a45f15f4266ffa14ef01d61e218524b9c7a42da81aaa9b78bb
Contents?: true
Size: 536 Bytes
Versions: 1
Compression:
Stored size: 536 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(root_path) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_core-1.3.2 | app/controllers/spree/locale_controller.rb |