Check that locale is well formed.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11096 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
6f614c034f
commit
3218b8204c
|
@ -43,7 +43,15 @@ namespace :locales do
|
||||||
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
||||||
files.sort.each do |file|
|
files.sort.each do |file|
|
||||||
puts "parsing #{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 = file_strings[file_strings.keys.first]
|
||||||
|
|
||||||
file_strings.each do |key, string|
|
file_strings.each do |key, string|
|
||||||
|
|
Loading…
Reference in New Issue