Logo-small

3.4.3 Translating message catalog

To translate your message, a simple text editor is enough as long as your are sure to save the file under the UTF-8 encoding. Some text editors assist the user to handle .po files: Emacs, poedit,...

The following section suppose you are under Linux and your distribution gettext package is installed.

Once your file is translated, you compile it to its mo binary format with the msgfmt command:

msgfmt fr.po -o DrGeoII.mo

If you have more than one message catalogs, you can use a little bash script like:

#!/bin/sh
LANG="es fr"
PODIR="po"
MODIR="locale"
# Compile .po files
for l in $LANG; do
   msgfmt $PODIR/$l.po -o $MODIR/$l/LC_MESSAGES/DrGeoII.mo
done

The source message files are in the po folder. The compiled mo catalog files are in locale/fr/LC_MESSAGES/DrGeoII.mo and locale/es/LC_MESSAGE/DrGeoII.mo.

Once the binary catalog is ready, we explain in the next section how to install it.

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |