From d5e1fc1c612e8edf6c571d019cf68ba66b3bee64 Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Mon, 8 Aug 2011 15:24:01 +0100 Subject: Introduce config setting to ignore browser language settings --- app/controllers/application_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/controllers/application_controller.rb') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2918f39c0..0d8c83d6c 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -42,7 +42,11 @@ class ApplicationController < ActionController::Base end def set_gettext_locale - requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale + if MySociety::Config.get('USE_DEFAULT_BROWSER_LANGUAGE', true) + requested_locale = params[:locale] || session[:locale] || cookies[:locale] || request.env['HTTP_ACCEPT_LANGUAGE'] || I18n.default_locale + else + requested_locale = params[:locale] || session[:locale] || cookies[:locale] || I18n.default_locale + end session[:locale] = FastGettext.set_locale(requested_locale) end -- cgit v1.2.3