diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4b2a310b..275d854b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -155,10 +155,10 @@ class ApplicationController < ActionController::Base #check if the default locale is present or not elsif params[:locale] condition = @site.in_use_locales.include?(params[:locale]) - elsif @site.default_locale.present? + elsif (@site.default_locale.present? && @site.enable_language_detection.eql?(false)) default_locale = @site.default_locale condition = @site.in_use_locales.include?(default_locale) - elsif @site.enable_language_detection + elsif (@site.enable_language_detection.eql?(true)) #check enable langauge detection browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil condition = @site.in_use_locales.include?(browser_locale)