Differences between revisions 15 and 16
Revision 15 as of 2021-05-24 12:19:12
Size: 3169
Comment:
Revision 16 as of 2021-09-24 23:00:08
Size: 3214
Editor: ThiagoPezzo
Comment: Add category
Deletions are marked like this. Additions are marked like this.
Line 96: Line 96:
----
CategoryLocalization CategorySoftware

This page is a draft - it is work in progress

Description

po4a (PO for anything) eases the maintenance of documentation translation using the classical gettext tools. The main feature of po4a is that it decouples the translation of content from its document.

The philosophy of Free Software is to make the technology truly available to everyone. But licensing is not the only consideration: untranslated free software is useless for non-English speakers. Therefore, we still have some work to do to make software available to everybody.

Especially in the case of technical documentation, it is essential the translations can be updated timely too.

You can use it for different document formats like

  • man
  • AsciiDoc

  • pod
  • sgml
  • TeX / LaTeX
  • text
  • xml and XHMTL
  • texinfo

HowTo

Translation of LaTeX files

  • Preamble in each language

Workflow

Workflow for LaTeX documents esp. noweb documents:

* *.nw -> *.tex
Converting *.nw file into *.tex file. This step is only needed in case of noweb documents.
     noweave -index -delay <file name>.nw > <file name>.tex
* *.tex -> *.pot
Converting *.tex file into *.pot file. A *.pot file is a template for language specific *.po files.
    po4a-gettextize --format latex --master-charset utf8 \
    --copyright-holder "<name>" \
    --package-name "<package name>" --package-version "<version>" \
    --master <file name>.tex --po <file name>.pot
* *.pot -> *.po
Using *.pot file to create *.po file (you have to create a *.po file for each language)
    msginit --input=<file name>.pot \
    --output-file=<file name>.po \
    --locale=<ISO code for language> --no-translator

or for updating existing *.po file with msgmerge.

    msgmerge --verbose --update <file name>.po  <file name>.pot
* Translations

Translations will be done in *.po files. gtranslator (GNOME Translation Editor) is a po file editor which makes translating gettext applications as easy as possible, even for people with no translation experience.

* *.po -> *.tex
Converting *.po file into *.tex file.
     po4a-translate --format latex --master-charset utf8 \
     --master <path>/<file name>.tex \
     --localized <path>/<file name>.tex \
     --po <po-Datei>.po --keep 30
Minimal threshold for translation percentage to keep (i.e. write) the resulting file is set to 30 (default: 80). I.e. by default, files have to be translated at least at 80% to get written; here 30% are enough.
* Create book

with pdflatex

     pdflatex <file name>.tex

A bibliography can be created with bibtex.

* Create e-books

epub format:

     tex4ebook -f epub <file name>.tex <directory for the e-book>

E-books using the mobi format have to be created with calibre.

You can find a shell script to image the process.


CategoryLocalization CategorySoftware