An Internationalized Software Project With Auto Tools
Prev gettext Overview Next

gettext Overview

gettext is a library, which allows to write multi-lingual software. The main idea is to mark strings in the source code for translation. A special tool extracts all these strings and merges them into so called .po files. For each language the project should be translated into, one .po file exists. These .po files are then translated by a translator. Technically the translations are placed below to the original strings in the .po file. During the compilation of the .po files, they are converted into binary .gmo files. These are installed with the project (and for some reason renamed during the installion into *.mo). On runtime the libtool libraries seek the corresponding .mo file. If it does not exist, the english strings are used. If it exists, each string is looked up in the .mo file and replaced by its translation. As the result, the program now displays strings in a different language.

The workflow in more detail is the following: This is an important part of the internationalization, but just a part. It is also important, that the program supports the character sets, required for all target languages. Character set struggle can be avoided by makling the application unicode aware. Furthermore it should be localized, i.e. displaying dates, numbers etc. in the local way. Locale handling is part of the standard c library.

So gettext is mainly a toolkit, a library and a workflow. But gettext integration into the gnu auto tools might simplify the .po, .pot, .gmo and .mo file handling. Unfortunately it requires several steps, which are described in the next chapter.
Prev Home Next
Adding libtool Support Adding gettext support