Friday, December 07, 2012

Using Transifex client to translate CloudStack docs

In a previous post I showed how to translate CloudStack documentation from the Web UI of the transifex website. Afterwards I sensed paranormal activities suggesting that developers would not use a Web UI and I better show how to do it from the good old command line. And yes, it is possible. Here we go:

The key is the almost magical transifex client. Install it, learn to use it, submit translations and the CloudStack committers will be able to pull your translations and build the documentation in the translated language.

Transifex can be a little overwhelming a first. At least I was. But the easiest way to get started is to actually start translating and not worry about setting up the projects. So jump right away to this part of the tx guide.

You will need to enter a few commands to get things setup:

  1. Get an account on transifex
  2. Get the transifex client:
    sudo easy_install transifex-client
  3. Initialize the project:
    tx init
  4. Point to the CloudStack Transifex project:
    tx set --auto-remote https://www.transifex.com/projects/p/ACS_DOCS/
  5. Pull all the resources:
    tx pull -s
  6. Pull all the existing translations:
    tx pull -a
  7. Pick a resource and make a copy with the language code of your target language, for example:
    cp translations/ACS_DOCS.pod-add/en.po translations/ACS_DOCS.pod-add/fr.po
  8. Enter your translation in the msgstr lines:
    vi translations/ACS_DOCS.pod-add/fr.po
  9. Push your tranlation (replace the language code and the resource name with yours):
    tx push -l fr -r ACS_DOCS.pod-add -t

That's it. You can go back to the Transifex project and you will see that your translation has been received. If you want to get a little more fancy, check out this guide, it contains a description of the push and pull commands. Get translating !

Parting thoughts: Using tx for translation only is actually relatively straightforward, once you have read the docs :) Setting a documentation project up for translation is a little more challenging. At CloudStack we use publican. Publican makes it easy to prepare a project for translation. Freezing the documentation, setting it up for translation and pulling everything back together before a release, might however, be a significant challenge.

No comments:

Post a Comment