itools.odf: An Enterprise Document Translation Infrastrucure

  • Developers: Sylvain Taverne
  • Mentors: Hervé Cauwelier

AbstractThe itools library includes an XML engine and localization tools to extract messages, and merge translations back into a copy of the source document.

he OpenDocument Format (ODF) is mostly an XML document with a clean separation of contents, style and layout.

The idea is to implement the semantics of the OpenDocument XML namespace and reuse the internationalization infrastructure from itools.

ODF Internationalization Infrastructure

Goals

  1. To load the XML document containing the contents and separate it from the extra information.
  2. To generate a translation template (.pot) from the source language.
  3. To merge the translation (.po) from human translators back into a copy of the source document using the same style and layout.
  4. To be able to reuse the same workflow with a updated revision of the source document and update the translations without having to start all over again (merging).

Status

Accepted and merged in the stable branch. Browse the source code

Usage

Install itools and the gettext package from your system.

Extracting text

$ igettext-extract.py document.odt > locale.pot

Add a new translation

$ cp locale.pot pt.po

Update an existing translation

If the master document changes:

$ msgmerge -U -s pt.po locale.pot

The Human Translator

Editing the XX.po files... No help is provided here. :-)

The Build Process

$ igettext-build.py document.odt pt.po -o document_pt.odt

Appendix

To automatize the process an option is to write a Makefile.

iKaaro is a Content Management System (CMS) to easily build, deploy and maintain web sites and applications.
itools is the indispensable toolbox for the advanced Python developer: a virtual file system, an index and search engine, a web programming interface, and much more!
Localizer is the de-facto standard way to build multilingual web applications with Zope.
The ODF Internationalization (i18n) Test Suite includes more than 200 tests illustrating how to convert an ODF document to a translation file (like PO).