+
+ def self.locale_dict_for(localeIn)
+ locale = localeIn.to_s.gsub("-","_")
+ full_local_path = File.expand_path("node_modules/osm-community-index/i18n/"+locale+".yaml", Dir.pwd)
+ locale_dict = {}
+ if File.exists?(full_local_path)
+ locale_dict = YAML.load(File.read(full_local_path))[locale]
+ else
+ shortened_locale = locale.split("_").first
+ if shortened_locale != locale
+ shortened_local_path = File.expand_path("node_modules/osm-community-index/i18n/"+shortened_locale+".yaml", Dir.pwd)
+ if File.exists?(shortened_local_path)
+ locale_dict = YAML.load(File.read(shortened_local_path))[shortened_locale]
+ end
+ end
+ end
+ return locale_dict
+ end
+