Mercurial > hg > soundsoftware-site
diff lib/tasks/locales.rake @ 1464:261b3d9a4903 redmine-2.4
Update to Redmine 2.4 branch rev 12663
author | Chris Cannam |
---|---|
date | Tue, 14 Jan 2014 14:37:42 +0000 |
parents | 433d4f72a19b |
children |
line wrap: on
line diff
--- a/lib/tasks/locales.rake Fri Jun 14 09:05:06 2013 +0100 +++ b/lib/tasks/locales.rake Tue Jan 14 14:37:42 2014 +0000 @@ -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|