diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 65b80c80..0b8ab3e3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -164,10 +164,10 @@ class ApplicationController < ActionController::Base condition = @site.in_use_locales.include?(browser_locale) elsif (@site.default_locale.nil? && @site.enable_language_detection.eql?(false) && session[:locale].nil?) session[:locale] = @site.valid_locales.first - condition = @site.in_use_locales.include?(session[:locale]) + condition = @site.in_use_locales.include?(params[:locale]) end - session[:locale] = condition ? (browser_locale || session[:locale] || default_locale || backup_locale) : I18n.default_locale.to_s + session[:locale] = condition ? ( session[:locale] || default_locale || browser_locale || backup_locale) : I18n.default_locale.to_s I18n.locale = session[:locale].to_sym @site_in_use_locales = @site.in_use_locales @site_valid_locales = site_locales_default_head(@site.valid_locales)