X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/39b60219fe37d1e3f94555a053895adc1eee179c..8eb2abc10cff2dd4b23a4d667db9d9db5731c972:/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