mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Replace YAML.load with YAML.load_file in locales.rake and improve error reporting for invalid YAML files (#39207).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22356 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
225156861b
commit
3c677a82c7
@ -10,12 +10,12 @@ namespace :locales do
|
||||
task :update do
|
||||
dir = ENV['DIR'] || './config/locales'
|
||||
|
||||
en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en']
|
||||
en_strings = YAML.load_file(File.join(dir,'en.yml'))['en']
|
||||
|
||||
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
||||
files.sort.each do |file|
|
||||
puts "Updating file #{file}"
|
||||
file_strings = YAML.load(File.read(file))
|
||||
file_strings = YAML.load_file(file)
|
||||
file_strings = file_strings[file_strings.keys.first]
|
||||
|
||||
missing_keys = en_strings.keys - file_strings.keys
|
||||
@ -39,7 +39,7 @@ namespace :locales do
|
||||
desc 'Checks interpolation arguments in locals against en.yml'
|
||||
task :check_interpolation do
|
||||
dir = ENV['DIR'] || './config/locales'
|
||||
en_strings = YAML.load(File.read(File.join(dir,'en.yml')))['en']
|
||||
en_strings = YAML.load_file(File.join(dir,'en.yml'))['en']
|
||||
files = Dir.glob(File.join(dir,'*.{yaml,yml}'))
|
||||
files.sort.each do |file|
|
||||
puts "parsing #{file}..."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user