Guidelines to translate the program (draft)

LenMus software is written with the wxWidgets application framework and follows wxWidgets approach to internationalization. This approach closely follows the GNU gettext package.

LenMus uses the message catalogs which are binary compatible with gettext catalogs and this allows to use all of the programs in this package to work with them. But note that no additional libraries are needed during run-time, however, so you have only the message catalogs to distribute and nothing else.

There are two kinds of message catalogs: source catalogs which are text files with extension .po and binary catalogs which are created from the source ones with msgfmt program (part of gettext package) and have the extension .mo. Only the binary files are needed during program execution.

Translating LenMus to other language involves several steps:

  1. Download the .po file. This file contains all the strings that have to be translated.
  2. Edit the .po file and provide a translation for each string.
  3. Compile the .po file into .mo file to be used by the program.
  4. Submit the .mo file for inclusion in the package.

Note for developers In order that new language name appears translated to the local name instead that in English it must be included in Language.cpp, method GetLanguage().

See the GNU gettext documentation linked from docs/html/index.htm in your wxWidgets distribution.


A standard .po file begins with a header like this:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-19 16:03+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
Note this particular line:

"Content-Type: text/plain; charset=CHARSET\n"
It specifies the charset used by the catalog. All strings in the catalog are encoded using this charset.

You have to fill in proper charset information. Your .po file may look like this after doing so:

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 1999-02-19 16:03+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
(Make sure that the header is not marked as fuzzy.)

LenMus is able to use this catalog under any supported platform (although iso8859-2 is a Unix encoding and is normally not understood by Windows).