Don't fall back to name:en if it's not in the user's language list

Fix to #2755
This commit is contained in:
Tom Hughes 2020-08-06 14:21:30 +01:00
parent c24c2e481c
commit 4d2ea31516
2 changed files with 4 additions and 4 deletions

View file

@ -13,7 +13,7 @@ module BrowseHelper
unless object.redacted?
available_locales = Locale.list(name_locales(object))
locale = available_locales.preferred(preferred_languages)
locale = available_locales.preferred(preferred_languages, :default => nil)
if object.tags.include? "name:#{locale}"
name = t "printable_name.with_name_html", :name => tag.bdi(object.tags["name:#{locale}"].to_s), :id => tag.bdi(name)