2007-09-02 12:08:10 +04:00
|
|
|
desc 'Load Redmine default configuration data'
|
2006-07-29 23:54:22 +04:00
|
|
|
|
2007-09-02 12:08:10 +04:00
|
|
|
namespace :redmine do
|
2008-01-04 21:27:05 +03:00
|
|
|
task :load_default_data => :environment do
|
|
|
|
include GLoc
|
|
|
|
set_language_if_valid('en')
|
|
|
|
puts
|
2007-01-02 00:34:10 +03:00
|
|
|
|
2008-01-04 21:27:05 +03:00
|
|
|
while true
|
|
|
|
print "Select language: "
|
|
|
|
print GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }.join(", ")
|
|
|
|
print " [#{GLoc.current_language}] "
|
|
|
|
lang = STDIN.gets.chomp!
|
|
|
|
break if lang.empty?
|
|
|
|
break if set_language_if_valid(lang)
|
|
|
|
puts "Unknown language!"
|
|
|
|
end
|
2006-11-12 21:50:30 +03:00
|
|
|
|
2008-01-04 21:27:05 +03:00
|
|
|
puts "===================================="
|
|
|
|
|
|
|
|
begin
|
|
|
|
Redmine::DefaultData::Loader.load(current_language)
|
|
|
|
puts "Default configuration data loaded."
|
|
|
|
rescue => error
|
|
|
|
puts "Error: " + error
|
|
|
|
puts "Default configuration data was not loaded."
|
|
|
|
end
|
|
|
|
end
|
2007-09-02 12:08:10 +04:00
|
|
|
end
|