X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c24c2e481cc6d27e76274ed4e32668a4690a7788..2c57b34b0dd1df993dd28b63f1bba25539b473f6:/app/helpers/browse_helper.rb?ds=sidebyside diff --git a/app/helpers/browse_helper.rb b/app/helpers/browse_helper.rb index cf2bc6474..0f533770b 100644 --- a/app/helpers/browse_helper.rb +++ b/app/helpers/browse_helper.rb @@ -1,5 +1,5 @@ module BrowseHelper - def printable_name(object, version = false) + def printable_name(object, version: false) id = if object.id.is_a?(Array) object.id[0] else @@ -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) @@ -44,7 +44,7 @@ module BrowseHelper if object.redacted? "" else - h(icon_tags(object).map { |k, v| k + "=" + v }.to_sentence) + h(icon_tags(object).map { |k, v| "#{k}=#{v}" }.to_sentence) end end