Sha256: 71a9cccbafcb4ecd93e75a7d1e2736a0cde2cde39856277fb03fd7bfaf685d49
Contents?: true
Size: 518 Bytes
Versions: 60
Compression:
Stored size: 518 Bytes
Contents
module Spree class LocaleController < Spree::StoreController def set session['user_return_to'] = request.referer if request.referer&.starts_with?('http://' + request.host) if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale]) session[:locale] = I18n.locale = params[:locale] flash.notice = Spree.t(:locale_changed) else flash[:error] = Spree.t(:locale_not_changed) end redirect_back_or_default(spree.root_path) end end end
Version data entries
60 entries across 60 versions & 1 rubygems