]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/browse_helper.rb
Don't fall back to name:en if it's not in the user's language list
[rails.git] / app / helpers / browse_helper.rb
index 2f61631b7d2c356f28b5948277dca98258424ae4..4519567d2b7f8f7af1c81b8cd3b5f4704576f9cf 100644 (file)
@@ -13,14 +13,14 @@ 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 => content_tag(:bdi, object.tags["name:#{locale}"].to_s), :id => content_tag(:bdi, name)
+        name = t "printable_name.with_name_html", :name => tag.bdi(object.tags["name:#{locale}"].to_s), :id => tag.bdi(name)
       elsif object.tags.include? "name"
-        name = t "printable_name.with_name_html", :name => content_tag(:bdi, object.tags["name"].to_s), :id => content_tag(:bdi, name)
+        name = t "printable_name.with_name_html", :name => tag.bdi(object.tags["name"].to_s), :id => tag.bdi(name)
       elsif object.tags.include? "ref"
-        name = t "printable_name.with_name_html", :name => content_tag(:bdi, object.tags["ref"].to_s), :id => content_tag(:bdi, name)
+        name = t "printable_name.with_name_html", :name => tag.bdi(object.tags["ref"].to_s), :id => tag.bdi(name)
       end
     end