Michael Hill
mdhillca@gmail.com 2013

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

# Mark strings for translation

# Set up translations

Before the strings from your application can be translated, they need to be extracted from the source code.

Wrap messages or string literals in your code with the '`_()`' macro.

For C, this macro is defined in the glib/gi18n.h header file, which must be included at the top of your application source.

Your wrapped strings should look like this:

_("Press a key to continue")

This marks the strings as translatable, and at runtime calls gettext to substitute the translated strings.