aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/gettext.rake
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-02-14 16:48:08 +0000
committerLouise Crow <louise.crow@gmail.com>2013-02-14 16:48:08 +0000
commitd48bfd58f6ff26b2a34aa8d71d9d691f9fbc10e2 (patch)
treec026e8e6639f7f9ceed92b75fb8ed657c566d788 /lib/tasks/gettext.rake
parentf8cf582f8c7461bfd680aac9c87cb5377c39c30c (diff)
parent0747a2d66f65fd22d8ea275d9df29a7981a46d07 (diff)
Merge branch 'release/0.7' into wdtk
Diffstat (limited to 'lib/tasks/gettext.rake')
-rw-r--r--lib/tasks/gettext.rake15
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}")