From: Tom Hughes Date: Wed, 16 Nov 2011 09:21:23 +0000 (+0000) Subject: Explicitly select the default locale if we have no better ideas X-Git-Tag: live~5993 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/cbd687d0b1bf5232a04fba8b861ff9c53b37a2cb?ds=sidebyside Explicitly select the default locale if we have no better ideas --- diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0412080fa..e57638767 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -247,9 +247,7 @@ class ApplicationController < ActionController::Base end end - I18n.locale = request.compatible_language_from(I18n.available_locales) - - logger.info "Selected locale #{I18n.locale} from #{request.user_preferred_languages.inspect}" + I18n.locale = request.compatible_language_from(I18n.available_locales) || I18n.default_locale response.headers['Content-Language'] = I18n.locale.to_s end