[glib/glib-2-34] Improve i18n documentation
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-34] Improve i18n documentation
- Date: Mon, 26 Nov 2012 19:08:58 +0000 (UTC)
commit 658131f44d295db849fc2021b2414364bd51fefc
Author: SÃbastien Wilmet <swilmet gnome org>
Date: Thu Nov 22 19:41:19 2012 +0100
Improve i18n documentation
Clearly explain which gettext functions must be called. It depends
whether the program is an application or a library.
https://bugzilla.gnome.org/show_bug.cgi?id=688886
glib/ggettext.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/glib/ggettext.c b/glib/ggettext.c
index ff1bb6b..8270ae2 100644
--- a/glib/ggettext.c
+++ b/glib/ggettext.c
@@ -470,16 +470,21 @@ g_dngettext (const gchar *domain,
* easy-to-use form.
*
* 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, you must include
* <filename>glib/gi18n-lib.h</filename> <emphasis>after</emphasis> defining
* 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.
+ * For an application, note that you also have to call bindtextdomain(),
+ * bind_textdomain_codeset(), textdomain() and setlocale() early on in your
+ * main() to make gettext() work.
+ *
+ * For a library, you only have to call bindtextdomain() and
+ * bind_textdomain_codeset() in your initialization function. If your library
+ * doesn't have an initialization function, you can call the functions before
+ * the first translated message.
*
* The gettext manual covers details of how to set up message extraction
* with xgettext.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]