@@ -43,7 +43,15 namespace :locales do | |||||
43 | files = Dir.glob(File.join(dir,'*.{yaml,yml}')) |
|
43 | files = Dir.glob(File.join(dir,'*.{yaml,yml}')) | |
44 | files.sort.each do |file| |
|
44 | files.sort.each do |file| | |
45 | puts "parsing #{file}..." |
|
45 | puts "parsing #{file}..." | |
46 |
file_strings = YAML.load |
|
46 | file_strings = YAML.load_file(file) | |
|
47 | unless file_strings.is_a?(Hash) | |||
|
48 | puts "#{file}: content is not a Hash (#{file_strings.class.name})" | |||
|
49 | next | |||
|
50 | end | |||
|
51 | unless file_strings.keys.size == 1 | |||
|
52 | puts "#{file}: content has multiple keys (#{file_strings.keys.size})" | |||
|
53 | next | |||
|
54 | end | |||
47 | file_strings = file_strings[file_strings.keys.first] |
|
55 | file_strings = file_strings[file_strings.keys.first] | |
48 |
|
56 | |||
49 | file_strings.each do |key, string| |
|
57 | file_strings.each do |key, string| |
General Comments 0
You need to be logged in to leave comments.
Login now