X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f6d1b6cda4a4490b439f8f4b0b6b3034f4fc463e..90fd22e2a35cea1e4bc55185f93267c49fb37b6e:/app/controllers/diary_entries_controller.rb?ds=sidebyside diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index 6db32797a..1f9574b9c 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -47,6 +47,8 @@ class DiaryEntriesController < ApplicationController @title = t ".in_language_title", :language => Language.find(params[:language]).english_name entries = entries.where(:language_code => params[:language]) else + candidate_codes = preferred_languages.flat_map(&:candidates).uniq.map(&:to_s) + @languages = Language.where(:code => candidate_codes).in_order_of(:code, candidate_codes) @title = t ".title" end end