diff options
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gettext.rake | 15 | ||||
-rw-r--r-- | lib/tasks/rspec.rake | 5 | ||||
-rw-r--r-- | lib/tasks/translation.rake | 6 |
3 files changed, 18 insertions, 8 deletions
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index 787b4029f..c73c2584e 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -4,6 +4,15 @@ Dir["#{Gem.searcher.find('gettext_i18n_rails').full_gem_path}/lib/tasks/**/*.rak namespace :gettext do + desc 'Rewrite .po files into a consistent msgmerge format' + task :clean do + load_gettext + + Dir.glob("locale/*/app.po") do |po_file| + GetText::msgmerge(po_file, po_file, 'alaveteli', :msgmerge => [:sort_output, :no_location, :no_wrap]) + end + end + desc "Update pot file only, without fuzzy guesses (these are done by Transifex)" task :findpot => :environment do load_gettext @@ -17,12 +26,12 @@ namespace :gettext do #merge tmp.pot and existing pot FileUtils.mkdir_p('locale') - GetText::msgmerge("locale/app.pot", temp_pot, "alaveteli", :po_root => 'locale', :msgmerge=>[ :no_wrap, :sort_output ]) + GetText::msgmerge("locale/app.pot", temp_pot, "alaveteli", :po_root => 'locale', :msgmerge=>[ :no_wrap, :sort_output ]) Dir.glob("locale/*/app.po") do |po_file| - GetText::msgmerge(po_file, temp_pot, "alaveteli", :po_root => 'locale', :msgmerge=>[ :no_wrap, :sort_output ]) + GetText::msgmerge(po_file, temp_pot, "alaveteli", :po_root => 'locale', :msgmerge=>[ :no_wrap, :sort_output ]) end File.delete(temp_pot) - end + end def files_to_translate Dir.glob("{app,lib,config,locale}/**/*.{rb,erb,haml,rhtml}") diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 1eee74aee..d4fd4a9ff 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -23,6 +23,9 @@ rescue MissingSourceFile module Spec module Rake class SpecTask + if defined?(::Rake::DSL) + include ::Rake::DSL + end def initialize(name) task name do # if rspec-rails is a configured gem, this will output helpful material and exit ... @@ -52,8 +55,6 @@ end task :default => :spec task :stats => "spec:statsetup" -# XXX commonlib tests are not Ruby 1.9 compatible -#task :spec => ['spec:commonlib'] task :test => ['spec'] task :cruise => ['spec'] diff --git a/lib/tasks/translation.rake b/lib/tasks/translation.rake index 273c12bfa..ff07fc6f6 100644 --- a/lib/tasks/translation.rake +++ b/lib/tasks/translation.rake @@ -4,7 +4,7 @@ namespace :translation do include Usage def write_email(email, email_description, output_file) - mail_object = MailHandler.mail_from_raw_email(email.to_s, decode=false) + mail_object = MailHandler.mail_from_raw_email(email.to_s) output_file.write("\n") output_file.write("Description of email: #{email_description}\n") output_file.write("Subject line: #{mail_object.subject}\n") @@ -49,7 +49,7 @@ namespace :translation do write_email(followup_email, 'Follow up', output_file) # contact mailer - contact_email = ContactMailer.create_message(info_request.user_name, + contact_email = ContactMailer.create_to_admin_message(info_request.user_name, info_request.user.email, 'A test message', 'Hello!', @@ -86,7 +86,7 @@ namespace :translation do 'fixtures', 'files', 'incoming-request-plain.email')) - response_mail = MailHandler.mail_from_raw_email(content, decode=false) + response_mail = MailHandler.mail_from_raw_email(content) response_mail.from = "authority@example.com" stopped_responses_email = RequestMailer.create_stopped_responses(info_request, |