X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9d2f920feb9dce028b985e8d452538d3df7a1d9c..4b4449f7249837c89f2e33109521bf8e29ef8292:/app/controllers/application_controller.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a24df48e0..c354b5386 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -296,13 +296,13 @@ class ApplicationController < ActionController::Base end def preferred_languages - @languages ||= if params[:locale] - Locale.list(params[:locale]) - elsif current_user - current_user.preferred_languages - else - Locale.list(http_accept_language.user_preferred_languages) - end + @preferred_languages ||= if params[:locale] + Locale.list(params[:locale]) + elsif current_user + current_user.preferred_languages + else + Locale.list(http_accept_language.user_preferred_languages) + end end helper_method :preferred_languages