remove http header language detection

This commit is contained in:
Andreas Stephanides
2018-05-20 21:20:43 +02:00
parent f61681c5d0
commit 2ae99b4b9e

View File

@@ -9,11 +9,9 @@
if params[:locale] if params[:locale]
if I18n.available_locales.include?(params[:locale].to_sym) if I18n.available_locales.include?(params[:locale].to_sym)
session[:locale] = params[:locale] session[:locale] = params[:locale]
else else
flash.now[:notice]= "#{params[:locale]} translation not available" flash.now[:notice]= "#{params[:locale]} translation not available"
logger.error flash.now[:notice] logger.error flash.now[:notice]
end end
end end
http_header=request.env['HTTP_ACCEPT_LANGUAGE'] http_header=request.env['HTTP_ACCEPT_LANGUAGE']
@@ -22,8 +20,8 @@
else else
ht=nil ht=nil
end end
I18n.locale = session[:locale] || ht || I18n.default_locale I18n.locale = session[:locale] || I18n.default_locale
# removed ht from selection add || ht to check http header
session[:locale] = I18n.locale session[:locale] = I18n.locale
end end