Sha256: a514db282e7d06725061bdb1c9f983a8dda300a41d320823885a4aef57c69101
Contents?: true
Size: 658 Bytes
Versions: 49
Compression:
Stored size: 658 Bytes
Contents
# frozen_string_literal: true module Spree module Admin class LocaleController < Spree::Admin::BaseController def set locale = params[:switch_to_locale].to_s.presence if locale && I18n.available_locales.include?(locale.to_sym) I18n.locale = locale session[set_user_language_locale_key] = locale respond_to do |format| format.json { render json: { locale: locale, location: spree.admin_url } } end else respond_to do |format| format.json { render json: { locale: I18n.locale }, status: 404 } end end end end end end
Version data entries
49 entries across 49 versions & 1 rubygems