X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9e2132b83dbf479c5ee2ef176b74d7a3c1082da0..db616d347a81a4437fab1fe5278a57425a5db3f1:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f07cacbd6..44307d482 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -247,7 +247,7 @@ class ApplicationController < ActionController::Base end end - I18n.locale = request.compatible_language_from(I18n.available_locales) + I18n.locale = request.compatible_language_from(I18n.available_locales) || I18n.default_locale response.headers['Content-Language'] = I18n.locale.to_s end @@ -366,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