diff options
author | Henare Degan <henare.degan@gmail.com> | 2013-02-15 17:40:04 +1100 |
---|---|---|
committer | Henare Degan <henare.degan@gmail.com> | 2013-02-15 17:59:06 +1100 |
commit | a0f250204a376ce97a187cf8a9b2cb0b8c628298 (patch) | |
tree | 812504a7b8da2431b3fed6f38f6796cdbbc84e00 /lib/tasks/gettext.rake | |
parent | 8f1caab7990dc417e32b14cbb5f00c34a0ddc10c (diff) | |
parent | d16f2f8242352a2d3c0350275110453dd6ac6b12 (diff) |
Merge branch 'develop' into rails-3-spike
Conflicts:
Gemfile
Gemfile.lock
app/controllers/general_controller.rb
app/controllers/track_controller.rb
app/models/outgoing_message.rb
app/models/public_body.rb
app/models/user.rb
app/views/general/frontpage.rhtml
config/environment.rb
config/initializers/inflections.rb
config/initializers/mime_types.rb
db/migrate/094_remove_old_tags_foreign_key.rb
lib/timezone_fixes.rb
spec/models/request_mailer_spec.rb
spec/views/request/list.rhtml_spec.rb
Diffstat (limited to 'lib/tasks/gettext.rake')
-rw-r--r-- | lib/tasks/gettext.rake | 15 |
1 files changed, 12 insertions, 3 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}") |