Commit f1d94a63 by Greg Price

Add rake tasks for dealing with translations

parent 86e4f2a6
......@@ -25,15 +25,18 @@ found in the locale/ directory.
__ https://github.com/edx/edx-platform
edX uses Transifex to host translations. To use the Transifex client, be sure
it is installed (``pip install -r requirements.txt`` will do this for you), and
it is installed (``pip install transifex-client`` will do this for you), and
follow the instructions here__ to set up your ``.transifexrc`` file.
__ http://support.transifex.com/customer/portal/articles/1000855-configuring-the-client
To upload translations: ``tx push -s``
To upload strings to Transifex for translation when you change the set
of translatable strings: ``bundle exec rake i18n:push``
To download translations: ``tx pull -l <locale>``, where ``<language>``
indicates the desired language for the transifex resource(s).
To fetch the latest translations from Transifex: ``bundle exec rake i18n:pull``
The repository includes some translations so they will be available
upon deployment. To commit an update to these: ``bundle exec rake i18n:commit``
License
-------
......
......@@ -376,3 +376,26 @@ namespace :jobs do
Delayed::Worker.new(:min_priority => ENV['MIN_PRIORITY'], :max_priority => ENV['MAX_PRIORITY'], :queues => (ENV['QUEUES'] || ENV['QUEUE'] || '').split(','), :quiet => false).start
end
end
namespace :i18n do
desc "Push source strings to Transifex for translation"
task :push do
sh("tx push -s")
end
desc "Pull translated strings from Transifex"
task :pull do
sh("tx pull --mode=reviewed --all --minimum-perc=1")
end
desc "Clean the locale directory"
task :clean do
sh("git clean -f locale/")
end
desc "Commit translated strings to the repository"
task :commit => ["i18n:clean", "i18n:pull"] do
sh("git add locale")
sh("git commit -m 'Updated translations (autogenerated message)'")
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment