diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-05-08 13:55:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-05-08 13:55:24 +0000 |
commit | 18c7fb2f442ad51efbf170f18245947548bdae80 (patch) | |
tree | dc100c6af139527f27bc525d41b11158a1d4babe /docs | |
parent | 171e1115f2e28faaa118fafd1c88ad76eb28d9f5 (diff) | |
download | gtk+-18c7fb2f442ad51efbf170f18245947548bdae80.tar.gz |
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)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/reference/ChangeLog | 5 | ||||
-rw-r--r-- | docs/reference/gtk/question_index.sgml | 15 |
2 files changed, 16 insertions, 4 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index e8d8a39dc3..42d12e2ecc 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -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 === diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml index da2c310fce..771059a357 100644 --- a/docs/reference/gtk/question_index.sgml +++ b/docs/reference/gtk/question_index.sgml @@ -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> |