Load wiki link data at startup and shorten some file names

This commit is contained in:
Tom Hughes 2010-04-20 21:05:22 +01:00
parent d6755356e0
commit 546250f60b
4 changed files with 7 additions and 7 deletions

View file

@ -35,12 +35,11 @@ module BrowseHelper
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
if page = WIKI_PAGES[locale][type][lookup] rescue nil
url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"
elsif page = wiki_data["en"][type][lookup] rescue nil
elsif page = WIKI_PAGES["en"][type][lookup] rescue nil
url = "http://wiki.openstreetmap.org/wiki/#{page}?uselang=#{locale}"
end