Fixed Language issue with browser language

This commit is contained in:
saurabhbhatia 2013-12-06 17:17:39 +08:00
parent 3bb1baf013
commit 87c3090784
1 changed files with 2 additions and 2 deletions

View File

@ -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)