X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/4408416b62a67bab980f9fdec3e4be04a7680039..7b89dc63496de0b6131a93c57d283ebb4490804b:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0412080fa..44307d482 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 @@ -368,6 +366,11 @@ private return [user, pass] end + # used by oauth plugin to get the current user + def current_user + @user + end + # used by oauth plugin to set the current user def current_user=(user) @user=user