X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/f6d1b6cda4a4490b439f8f4b0b6b3034f4fc463e..0b05f4701672d7107cb45d9fb4de13819f7df863:/app/controllers/diary_entries_controller.rb 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