Permalink
Browse files

Move sync task to the proper level

  • Loading branch information...
1 parent 17d886c commit 826ab6944cf1f2b9361982b70597f2ecebf4149c @davec committed Jul 2, 2010
Showing with 14 additions and 14 deletions.
  1. +14 −14 lib/tasks/events_calendar_extension_tasks.rake
View
28 lib/tasks/events_calendar_extension_tasks.rake
@@ -33,22 +33,22 @@ namespace :radiant do
cp file, local_tasks_path, :verbose => false
end
end
+ end
- desc "Syncs all available translations for this ext to the English ext master"
- task :sync => :environment do
- # The main translation root, basically where English is kept
- language_root = EventsCalendarExtension.get_translation_keys(language_root)
- words = TranslationSupport.get_translation_keys(language_root)
+ desc "Syncs all available translations for this ext to the English ext master"
+ task :sync => :environment do
+ # The main translation root, basically where English is kept
+ language_root = EventsCalendarExtension.get_translation_keys(language_root)
+ words = TranslationSupport.get_translation_keys(language_root)
- Dir["#{language_root}/*.yml"].each do |filename|
- next if filename.match('_available_tags')
- basename = File.basename(filename, '.yml')
- puts "Syncing #{basename}"
- (comments, other) = TranslationSupport.read_file(filename, basename)
- words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist
- other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml
- TranslationSupport.write_file(filename, basename, comments, other)
- end
+ Dir["#{language_root}/*.yml"].each do |filename|
+ next if filename.match('_available_tags')
+ basename = File.basename(filename, '.yml')
+ puts "Syncing #{basename}"
+ (comments, other) = TranslationSupport.read_file(filename, basename)
+ words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist
+ other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml
+ TranslationSupport.write_file(filename, basename, comments, other)
end
end
end

0 comments on commit 826ab69

Please sign in to comment.