openstreetmap-website/app/helpers/browse_helper.rb
Ævar Arnfjörð Bjarmason bc66c8adeb Make the printable_name() function call i18n.t to translate its
output. Makes e.g. "#{name}, v#{object.version.to_s}" which is used in
the changeset browser translatable.

I'm still not happy with how the anchor is constructed. we're linking
from /browse/changeset/1234 to e.g. node "[[366672999, v1]]" even
though the page we're linking to might take us to that node at version
2. The link should be "[[366672999]], v1" instead.

But that's something to solve later.
2009-06-28 21:13:27 +00:00

16 lines
490 B
Ruby

module BrowseHelper
def link_to_page(page, page_param)
return link_to(page, page_param => page)
end
def printable_name(object, version=false)
name = t 'printable_name.with_id', :id => object.id.to_s
if version
name = t 'printable_name.with_version', :id => name, :version => object.version.to_s
end
if object.tags.include? 'name'
name = t 'printable_name.with_name', :name => object.tags['name'].to_s, :id => name
end
return name
end
end