- def wikify(type, key, tag, text, wiki)
- my_locale = I18n.locale
- url = "http://wiki.openstreetmap.org/wiki/#{wiki}?uselang=#{my_locale}"
-
- if type == "key"
- return '<a href="' + url + '" title="' + h(t('browse.tag_details.wiki_link.key', :key => key)) + '">' + h(text) + '</a>'
- else
- return '<a href="' + url + '" title="' + h(t('browse.tag_details.wiki_link.tag', :key => key, :value => tag)) + '">' + h(tag) + '</a>'
+private
+
+ def wiki_link(type, lookup)
+ wiki_data = YAML.load_file("#{RAILS_ROOT}/config/wiki-tag-and-key-description.yml")
+ locale = I18n.locale.to_s
+
+ if page = wiki_data[locale][type][lookup] rescue nil
+ url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"
+ elsif page = wiki_data["en"][type][lookup] rescue nil
+ url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"