X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/2f3e23f6eb2bd571a39486773f0f10d65a2398a1..1368f194da3834559c195e6a9e269cd4cb580437:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d7debcb6d..00104b0a1 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -45,7 +45,6 @@ class ApplicationController < ActionController::Base # handle authenticate pass/fail unless @user # no auth, the user does not exist or the password was wrong - response.headers["Status"] = "Unauthorized" response.headers["WWW-Authenticate"] = "Basic realm=\"#{realm}\"" render :text => errormessage, :status => :unauthorized return false @@ -111,8 +110,9 @@ class ApplicationController < ActionController::Base end end - I18n.locale = request.compatible_language_from(I18n.available_locales) - + I18n.locale = request.preferred_language_from(I18n.available_locales) || + request.compatible_language_from(I18n.available_locales) + logger.info("Select #{I18n.locale} matching #{request.user_preferred_languages.join(',')} against #{I18n.available_locales.join(',')}") response.headers['Content-Language'] = I18n.locale.to_s end