Docs: Mention gettext setup requirements in i18n section

This commit is contained in:
Matthias Clasen 2011-02-12 12:09:39 -05:00
parent 562f29afdc
commit deab106457

View File

@ -8,11 +8,11 @@ gettext support macros
<para> <para>
GLib doesn't force any particular localization method upon its users. GLib doesn't force any particular localization method upon its users.
But since GLib itself is localized using the gettext() mechanism, it seems But since GLib itself is localized using the gettext() mechanism, it seems
natural to offer the de-facto standard gettext() support macros in an natural to offer the de-facto standard gettext() support macros in an
easy-to-use form. easy-to-use form.
</para> </para>
<para> <para>
In order to use these macros in an application, you must include In order to use these macros in an application, you must include
<filename>glib/gi18n.h</filename>. For use in a library, must include <filename>glib/gi18n.h</filename>. For use in a library, must include
<filename>glib/gi18n-lib.h</filename> <emphasis>after</emphasis> defining <filename>glib/gi18n-lib.h</filename> <emphasis>after</emphasis> defining
the GETTEXT_PACKAGE macro suitably for your library: the GETTEXT_PACKAGE macro suitably for your library:
@ -20,6 +20,10 @@ the GETTEXT_PACKAGE macro suitably for your library:
&num;define GETTEXT_PACKAGE "gtk20" &num;define GETTEXT_PACKAGE "gtk20"
&num;include &lt;glib/gi18n-lib.h&gt; &num;include &lt;glib/gi18n-lib.h&gt;
</programlisting></informalexample> </programlisting></informalexample>
Note that you also have to call setlocale() and textdomain() (as well as
bindtextdomain() and bind_textdomain_codeset()) early on in your main()
to make gettext() work.
The gettext manual covers details of how to set up message extraction The gettext manual covers details of how to set up message extraction
with xgettext. with xgettext.
</para> </para>
@ -237,3 +241,12 @@ Intltool has support for the NC_() macro since version 0.40.1.
@Returns: @Returns:
<!-- ##### FUNCTION g_get_locale_variants ##### -->
<para>
</para>
@locale:
@Returns: