mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
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
This commit is contained in:
parent
276cf6ceee
commit
2b7c2107a5
@ -472,16 +472,21 @@ g_dngettext (const gchar *domain,
|
|||||||
* easy-to-use form.
|
* 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
|
||||||
* <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
|
* <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:
|
||||||
* |[
|
* |[
|
||||||
* #define GETTEXT_PACKAGE "gtk20"
|
* #define GETTEXT_PACKAGE "gtk20"
|
||||||
* #include <glib/gi18n-lib.h>
|
* #include <glib/gi18n-lib.h>
|
||||||
* ]|
|
* ]|
|
||||||
* Note that you also have to call setlocale() and textdomain() (as well as
|
* For an application, note that you also have to call bindtextdomain(),
|
||||||
* bindtextdomain() and bind_textdomain_codeset()) early on in your main()
|
* bind_textdomain_codeset(), textdomain() and setlocale() early on in your
|
||||||
* to make gettext() work.
|
* 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
|
* The gettext manual covers details of how to set up message extraction
|
||||||
* with xgettext.
|
* with xgettext.
|
||||||
|
Loading…
Reference in New Issue
Block a user