diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-02-03 13:39:24 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-02-03 13:39:24 +0000 |
commit | bf4bbc351dae8e97d09b87434cef4f44eea4d73a (patch) | |
tree | 2f43c9c02205fec1fb68cdcb66735d5b1ee3172f /lib/tasks/gettext.rake | |
parent | ea04caec95cea132143997a1870ae8dd1fc0db5c (diff) | |
parent | 14b5be69dc2dc3c4dd817feb0b5a8402fc343db4 (diff) |
Merge branch 'release/0.5' into develop
Diffstat (limited to 'lib/tasks/gettext.rake')
-rw-r--r-- | lib/tasks/gettext.rake | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index 017e7c837..8ffd5ce1b 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -1,5 +1,23 @@ namespace :gettext do + + desc "Update pot file only, without fuzzy guesses (these are done by Transifex)" + task :findpot => :environment do + load_gettext + $LOAD_PATH << File.join(File.dirname(__FILE__),'..','..','lib') + require 'gettext_i18n_rails/haml_parser' + files = files_to_translate + + #write found messages to tmp.pot + temp_pot = "tmp.pot" + GetText::rgettext(files, temp_pot) + + #merge tmp.pot and existing pot + FileUtils.mkdir_p('locale') + GetText::msgmerge("locale/app.pot", temp_pot, "version 0.0.1", :po_root => 'locale', :msgmerge=>[ :no_fuzzy_matching, :sort_output ]) + File.delete(temp_pot) + end + def files_to_translate Dir.glob("{app,lib,config,locale}/**/*.{rb,erb,haml,rhtml}") end -end
\ No newline at end of file +end |