1 (edited by Rémi 2012-06-22 11:31:06)

Topic: How to translate Siren 3

The translatable text can be divided into two parts:

  • the user interface

  • the help

The translated files are located in a subdirectory of "locale" named after the "code" of the language you're working on.
For example: locale/en, locale/en_US, locale/fr ...

1) The user interface
Siren uses wxWidgets's translation system which is based on GNU "gettext".
"siren.mo" is the "compiled" version of "siren.po". Siren only needs the ".mo" file.
Tools like Poedit are perfect for the job.   

The simplest way to achieve the translation is:

  1. Create a directory named after your language code and download/extract into it the "siren.po"
    present at this address.

  2. Change the project meta data of your "siren.po"
    For example, in Poedit go to "Catalog/Configuration".
    Note that the translator name and email will be displayed in Siren's "About ..." window.

  3. Translate your "siren.po"
    Take care of the "printf-like" parameters (%s, %d ...)
    Don't be limited by the original string lengths. The user interface should adapt.

  4. Generate your "siren.mo"
    Poedit will do it each time you save the ".po"

2) The help
The help file is named "siren.htb".
At run time if it is not present in the language code directory, Siren will look in the "locale" and finally in the executable one. 

"siren.htb" is a ".zip" file renamed ".htb".
Mainly, it contains ".htm" files using a limited HTML syntax. The entry is "index.htm".

Here are the elements that have to be modified:

  • The ".htm" files have to be translated
    Take care of the examples using dates: English date format is MM/DD/YYYY and, for example, in French it is DD/MM/YYYY.
    I can send you a small utility to display individual wxWidgets HTML files

  • The file "siren.hhc" contains the "Content" menu.
    In all the lines like: <param name="Name" value="xxxxx">
    the value has to be translated

  • The file "siren.hpp" contains the title of the help. It has to be translated too

  • Maybe the screenshots from the "user interface tips" page. I can do them if needed

The resulting files have to be compressed to a "siren.htb" zip file.

Thanks for your involvement !