feature use the name key corresponding to the user's locale. E.g. "name:is" for Icelandic. This will fall back on "name". The interface will be equivalent unless the user has selected another language than English in the preferences and objects with localized name:* tags corresponding to the user's language are being displayed.
18 lines
649 B
Ruby
18 lines
649 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:#{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
|