Commit 18c7fb2f authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Update the internationalization answer. (#340951, Kristof Versant)

2006-05-08  Matthias Clasen  <mclasen@redhat.com>

	* gtk/question_index.sgml (reference): Update the internationalization
	answer.  (#340951, Kristof Versant)
parent 171e1115
2006-05-08 Matthias Clasen <mclasen@redhat.com>
* gtk/question_index.sgml (reference): Update the internationalization
answer. (#340951, Kristof Versant)
2006-05-04 Matthias Clasen <mclasen@redhat.com>
* === Released 2.9.0 ===
......
......@@ -205,13 +205,15 @@ You eventually have to call gettext() on the string to actually fetch the
translation. _() both marks the string for translation and actually translates it.
</para>
<para>
Nowadays, GLib provides the common shorthand macros in the header file
<filename>gi18n.h</filename>, so you don't have to define them yourself, just
include that header.
</para>
<para>
Code using these macros ends up looking like this:
<informalexample>
<programlisting>
#include &lt;libintl.h&gt;
#define _(x) gettext (x)
#define N_(x) x
#include &lt;gi18n.h&gt;
static const char *global_variable = N_("Translate this string");
......@@ -238,6 +240,11 @@ of using the default.For dgettext() the _() macro can be defined as:
</programlisting>
</informalexample>
</para>
<para>
Again, GLib comes with the <filename>gi18n-lib.h</filename>, saving you the trouble
of defining the macros by hand. The macros in that header expect the translation
domain to be specified by the %GETTEXT_PACKAGE macro.
</para>
</answer>
</qandaentry>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment