From 87c30907846ab6e37892ee2db3469a0dde4a3483 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 6 Dec 2013 17:17:39 +0800 Subject: [PATCH] Fixed Language issue with browser language --- app/controllers/application_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)