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.
This work is licensed under a.
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.
Got a comment? Spotted an error? Found the instructions unclear? Send feedback about this page.