]> git.openstreetmap.org Git - rails.git/blobdiff - app/helpers/browse_helper.rb
Modify the existing i18n() javascript function to lookup strings in
[rails.git] / app / helpers / browse_helper.rb
index 67420151c48efa016f844028b7bfc9d0997af330..aed0c518f4ce46255f0597d47b1f8772abfd7472 100644 (file)
@@ -4,12 +4,14 @@ module BrowseHelper
   end
   
   def printable_name(object, version=false)
   end
   
   def printable_name(object, version=false)
-    name = object.id.to_s
+    name = t 'printable_name.with_id', :id => object.id.to_s
     if version
     if version
-      name = "#{name}, v#{object.version.to_s}"
+      name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
     end
     end
-    if object.tags.include? 'name'
-      name = "#{object.tags['name'].to_s} (#{name})"
+    if object.tags.include? "name:#{I18n.locale}"
+      name = t 'printable_name.with_name',  :name => object.tags["name:#{I18n.locale}"].to_s, :id => name
+    elsif object.tags.include? 'name'
+      name = t 'printable_name.with_name',  :name => object.tags['name'].to_s, :id => name
     end
     return name
   end
     end
     return name
   end