forked from AuroraMiddleware/gtk
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)
This commit is contained in:
parent
171e1115f2
commit
18c7fb2f44
@ -1,3 +1,8 @@
|
||||
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 <libintl.h>
|
||||
|
||||
#define _(x) gettext (x)
|
||||
#define N_(x) x
|
||||
#include <gi18n.h>
|
||||
|
||||
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user