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