Mercurial > hg > soundsoftware-site
diff lib/tasks/locales.rake @ 1295:622f24f53b42 redmine-2.3
Update to Redmine SVN revision 11972 on 2.3-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:02:21 +0100 |
parents | 433d4f72a19b |
children |
line wrap: on
line diff
--- a/lib/tasks/locales.rake Fri Jun 14 09:01:12 2013 +0100 +++ b/lib/tasks/locales.rake Fri Jun 14 09:02:21 2013 +0100 @@ -43,7 +43,15 @@ files = Dir.glob(File.join(dir,'*.{yaml,yml}')) files.sort.each do |file| puts "parsing #{file}..." - file_strings = YAML.load(File.read(file)) + file_strings = YAML.load_file(file) + unless file_strings.is_a?(Hash) + puts "#{file}: content is not a Hash (#{file_strings.class.name})" + next + end + unless file_strings.keys.size == 1 + puts "#{file}: content has multiple keys (#{file_strings.keys.size})" + next + end file_strings = file_strings[file_strings.keys.first] file_strings.each do |key, string|