Appendices

A little about gettext

If you are not a developer but rather a documentation or localization specialist (like I am), you probably do not need to know about gettext in detail. It is enough to know some general facts:

  • Gettext uses a message-as-key approach: there are no string resource identifiers in the source code, gettext uses the natural language strings inside the source code as keys for looking up translations. If no translation is available, gettext returns the original string.

    In my experience with Sphinx, the source language does not have to be English. I translated documentation from Russian to English, and everything worked perfectly.

  • Gettext is not specific for Python, as it is used in C, C++ development etc. Every time you work with .po files it almost certainly means that gettext is behind the scenes.

  • Gettext supports plural forms. We do not cover this feature in our guide, but it’s nice to know about the possibility.

Demo project files

Here you can find all the archives that are offered for download in the sections of this guide:

You can also find the demo project on Github.