Note

This is only a sample text for usege in the unit tests of Po4a.
It contains some reST constructs I'm using.

Translating text with the help of Po4a

Preface

Translating text into different languages is a tedious task. But with the help of some software it becomes manageable.

In particular I'm using

  • Po4a

  • virtaal

  • rest2html

    to create html pages from the reST source
    (don't wrap this line...)

Description

The original text is maintained in reST format. Then it's checked by Po4a to build a source (a po file) for the translation process.

After the translation of that po file (done with virtaal here) the new reST file is finally built by Po4a.

Of course that is the short version only.
But that should be enough to have a first impression.

The advantage in using Po4a here is that it's really easy to maintain translations.

Process

Following the steps of the process.

Originally I found it here:

http://www.paolocorti.net/2012/01/05/managing_documentation_translations_with_open_source_tools/

Initialization (once only)

po4a-gettextize -f text -o rest -m test_en.rst -M utf8 -p test.EN.pot

vi test.EN.pot

  • set the character set of the source
    • change
      • "Content-Type: text/plain; charset=CHARSETn"
    • to (or similar)
      • "Content-Type: text/plain; charset=UTF-8n"

cp test.EN.pot test.DE.po

The translation loop

Update of the translation sources
  • vi test_en.rst
  • po4a-updatepo -f text -o rest -m test_en.rst -M utf8 -p test.DE.po
Manual translation

virtaal test.DE.po

Build a translated reST file

po4a-translate -f text -o rest -m test_en.rst -M utf8 -p test.DE.po -l test_de.rst -k 10

Postprocessing

Creation of the final HTML files

  • rst2html -d -t --strip-comments test_de.rst > test_de.html
  • rst2html -d -t --strip-comments test_en.rst > test_en.html

Test part

Subsection

Subsection

Subsection
Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here

Test section

no real text here