Commit 24169eb8f612b27657c29b9e4036d2dfae035dbb

Authored by Antonio Terceiro
1 parent c1e978f6

Do not update PO files during upgrades

Showing 2 changed files with 14 additions and 1 deletions   Show diff stats
lib/tasks/doc.rake
@@ -97,5 +97,18 @@ namespace :noosfero do @@ -97,5 +97,18 @@ namespace :noosfero do
97 end 97 end
98 98
99 task :rebuild => [:clean, :build] 99 task :rebuild => [:clean, :build]
  100 +
  101 + task :translate => english_xhtml do
  102 + languages = Noosfero.locales.keys - ['en']
  103 + languages.each do |lang|
  104 + po = "po/#{lang}/noosfero-doc.po"
  105 + if File.exists?(po)
  106 + Dir['doc/noosfero/**/*.en.xhtml'].each do |doc|
  107 + target = doc.sub('.en.xhtml', ".#{lang}.xhtml")
  108 + sh "po4a-translate -f xhtml -M utf8 -m #{doc} -p #{po} -L utf8 -l #{target}"
  109 + end
  110 + end
  111 + end
  112 + end
100 end 113 end
101 end 114 end
lib/tasks/translation.rake
@@ -5,7 +5,7 @@ namespace :noosfero do @@ -5,7 +5,7 @@ namespace :noosfero do
5 task :update => ['updatepo', 'noosfero:doc:rebuild'] 5 task :update => ['updatepo', 'noosfero:doc:rebuild']
6 6
7 desc 'Compiles all translations' 7 desc 'Compiles all translations'
8 - task :compile => ['makemo', 'noosfero:doc:build'] 8 + task :compile => ['makemo', 'noosfero:doc:translate']
9 9
10 end 10 end
11 end 11 end