]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/browse_helper.rb
Bump image_processing from 1.12.1 to 1.12.2
[rails.git] / app / helpers / browse_helper.rb
index cf2bc64742dc6faebb72e511a7c9ebb958b537e2..0f533770b8042165245e0d036b066626c4b97a30 100644 (file)
@@ -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