Fixed backup locale and browser locale
This commit is contained in:
parent
88260d59e7
commit
b1936fcae9
|
@ -155,10 +155,10 @@ class ApplicationController < ActionController::Base
|
||||||
#check if the default locale is present or not
|
#check if the default locale is present or not
|
||||||
elsif params[:locale]
|
elsif params[:locale]
|
||||||
condition = @site.in_use_locales.include?(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
|
default_locale = @site.default_locale
|
||||||
condition = @site.in_use_locales.include?(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
|
#check enable langauge detection
|
||||||
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
browser_locale = request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first rescue nil
|
||||||
condition = @site.in_use_locales.include?(browser_locale)
|
condition = @site.in_use_locales.include?(browser_locale)
|
||||||
|
|
Loading…
Reference in New Issue