OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/lib/tasks/update_translations.rake

31 lines
985 B

desc 'Generate chart data for all backlogs'
require 'yaml'
namespace :redmine do
namespace :backlogs_plugin do
task :update_translations => :environment do
langdir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/config/locales'
template_file = "#{langdir}/en.yml"
template = YAML::load_file(template_file)['en']
Dir.glob("#{langdir}/*.yml").each {|lang_file|
next if lang_file == template_file
lang = YAML::load_file(lang_file)
l = lang.keys[0]
template.each_pair {|key, txt|
next if lang[l][key]
lang[l][key] = "[[#{txt}]]"
}
lang[l].keys.each {|k|
lang[l].delete(k) unless template[k]
}
File.open( lang_file, 'w' ) do |out|
YAML.dump(lang, out)
end
}
end
end
end