workaround for gettext parser bug

This commit is contained in:
Steve Strassmann
2013-05-03 12:45:55 -04:00
parent 22e147b2c9
commit 55dd0fc8bc
9 changed files with 145 additions and 39 deletions

View File

@@ -337,12 +337,6 @@ task :migrate, [:env] do |t, args|
sh(django_admin(:lms, args.env, 'migrate'))
end
desc "Run tests for the internationalization library"
task :test_i18n do
test = File.join(REPO_ROOT, "i18n", "tests")
sh("nosetests #{test}")
end
Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
task_name = "test_#{lib}"
@@ -516,27 +510,49 @@ end
# --- Internationalization tasks
desc "Extract localizable strings from sources"
task :extract_dev_strings do
sh(File.join(REPO_ROOT, "i18n", "extract.py"))
end
namespace :i18n do
desc "Compile localizable strings from sources. With optional flag 'extract', will extract strings first."
task :generate_i18n do
if ARGV.last.downcase == 'extract'
Rake::Task["extract_dev_strings"].execute
desc "Extract localizable strings from sources"
task :extract do
sh(File.join(REPO_ROOT, "i18n", "extract.py"))
end
sh(File.join(REPO_ROOT, "i18n", "generate.py"))
end
desc "Simulate international translation by generating dummy strings corresponding to source strings."
task :dummy_i18n do
source_files = Dir["#{REPO_ROOT}/conf/locale/en/LC_MESSAGES/*.po"]
dummy_locale = 'fr'
cmd = File.join(REPO_ROOT, "i18n", "make_dummy.py")
for file in source_files do
sh("#{cmd} #{file} #{dummy_locale}")
desc "Compile localizable strings from sources. With optional flag 'extract', will extract strings first."
task :generate do
if ARGV.last.downcase == 'extract'
Rake::Task["i18n:extract"].execute
end
sh(File.join(REPO_ROOT, "i18n", "generate.py"))
end
desc "Simulate international translation by generating dummy strings corresponding to source strings."
task :dummy do
source_files = Dir["#{REPO_ROOT}/conf/locale/en/LC_MESSAGES/*.po"]
dummy_locale = 'fr'
cmd = File.join(REPO_ROOT, "i18n", "make_dummy.py")
for file in source_files do
sh("#{cmd} #{file} #{dummy_locale}")
end
end
namespace :transifex do
desc "Push source strings to Transifex for translation"
task :push do
sh("tx push -s")
end
desc "Pull transated strings from Transifex"
task :pull do
sh("tx pull")
end
end
desc "Run tests for the internationalization library"
task :test do
test = File.join(REPO_ROOT, "i18n", "tests")
sh("nosetests #{test}")
end
end
# --- Develop and public documentation ---