Sha256: 730c9bc2dd7335d9647e7d93052b58e834f7eeee7233ae134d15815097eae336

Contents?: true

Size: 492 Bytes

Versions: 5

Compression:

Stored size: 492 Bytes

Contents

class LocaleController < ApplicationController

  def set
    if request.referer && request.referer.starts_with?("http://" + request.host)
      session[:return_to] = request.referer
    end
    if params[:locale] && AVAILABLE_LOCALES.include?(params[:locale])
      I18n.locale = params[:locale]
      session[:locale] = params[:locale]
      self.notice = t("locale_changed")
    else
      flash[:error] = t("locale_not_changed")
    end
    redirect_back_or_default(root_path)
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spree-0.11.4 app/controllers/locale_controller.rb
spree-0.11.3 app/controllers/locale_controller.rb
spree-0.11.2 app/controllers/locale_controller.rb
spree-0.11.1 app/controllers/locale_controller.rb
spree-0.11.0 app/controllers/locale_controller.rb