diff --git a/lib/tasks/doc.rake b/lib/tasks/doc.rake index 6af668e..54054fe 100644 --- a/lib/tasks/doc.rake +++ b/lib/tasks/doc.rake @@ -97,5 +97,18 @@ namespace :noosfero do end task :rebuild => [:clean, :build] + + task :translate => english_xhtml do + languages = Noosfero.locales.keys - ['en'] + languages.each do |lang| + po = "po/#{lang}/noosfero-doc.po" + if File.exists?(po) + Dir['doc/noosfero/**/*.en.xhtml'].each do |doc| + target = doc.sub('.en.xhtml', ".#{lang}.xhtml") + sh "po4a-translate -f xhtml -M utf8 -m #{doc} -p #{po} -L utf8 -l #{target}" + end + end + end + end end end diff --git a/lib/tasks/translation.rake b/lib/tasks/translation.rake index e210dde..00b6fcb 100644 --- a/lib/tasks/translation.rake +++ b/lib/tasks/translation.rake @@ -5,7 +5,7 @@ namespace :noosfero do task :update => ['updatepo', 'noosfero:doc:rebuild'] desc 'Compiles all translations' - task :compile => ['makemo', 'noosfero:doc:build'] + task :compile => ['makemo', 'noosfero:doc:translate'] end end -- libgit2 0.21.2