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/tasks/gloc_to_i18n.rake

18 lines
483 B

directory = File.dirname File.dirname(__FILE__)
project = File.basename directory
namespace :gloc_to_i18n do
task project do
chdir(directory) do
Dir.glob("lang/*.yml") do |file|
lang = file[5..-5]
target = "config/locales/#{lang}.yml"
mkdir_p File.dirname(target)
File.open(target, "w") do |f|
f << ({lang => YAML.load_file(file)}.to_yaml)
end
end
end
end
end
task :gloc_to_i18n => "gloc_to_i18n:#{project}"