From f948a0fd39e3fd15855a3de42289899dc5708fdb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 12 Feb 2011 12:09:39 -0500 Subject: [PATCH] Docs: Mention gettext setup requirements in i18n section --- docs/reference/glib/tmpl/i18n.sgml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/reference/glib/tmpl/i18n.sgml b/docs/reference/glib/tmpl/i18n.sgml index ebcc7d544..a56f803fa 100644 --- a/docs/reference/glib/tmpl/i18n.sgml +++ b/docs/reference/glib/tmpl/i18n.sgml @@ -8,11 +8,11 @@ gettext support macros GLib doesn't force any particular localization method upon its users. 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. -In order to use these macros in an application, you must include +In order to use these macros in an application, you must include glib/gi18n.h. For use in a library, must include glib/gi18n-lib.h after defining the GETTEXT_PACKAGE macro suitably for your library: @@ -20,6 +20,10 @@ the GETTEXT_PACKAGE macro suitably for your library: #define GETTEXT_PACKAGE "gtk20" #include <glib/gi18n-lib.h> +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 with xgettext. @@ -237,3 +241,12 @@ Intltool has support for the NC_() macro since version 0.40.1. @Returns: + + + + + +@locale: +@Returns: + +