X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/673b58f96f3acfd0281c62a2a7f080825b6fb28b..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