+ def getlocalized(lang)
+ # What we end up actually using. Reported in Potlatch's created_by=* string
+ loaded_lang = 'en'
+
+ # Load English defaults
+ en = YAML::load(File.open("#{RAILS_ROOT}/config/potlatch/locales/en.yml"))["en"]
+
+ if lang == 'en'
+ return [real_lang, en]
+ else
+ # Use English as a fallback
+ begin
+ other = YAML::load(File.open("#{RAILS_ROOT}/config/potlatch/locales/#{lang}.yml"))[lang]
+ loaded_lang = lang
+ rescue
+ other = en
+ end
+
+ # We have to return a flat list and some of the keys won't be
+ # translated (probably)
+ return [loaded_lang, en.merge(other)]
+ end
+ end
+