1 #ifndef __GLIBINTL_H__ 2 #define __GLIBINTL_H__ 3 4 #ifndef SIZEOF_CHAR 5 #error "config.h must be included prior to glibintl.h" 6 #endif 7 8 GLIB_AVAILABLE_IN_ALL 9 const gchar * glib_gettext (const gchar *str) G_GNUC_FORMAT(1); 10 GLIB_AVAILABLE_IN_ALL 11 const gchar * glib_pgettext (const gchar *msgctxtid, 12 gsize msgidoffset) G_GNUC_FORMAT(1); 13 14 #ifdef ENABLE_NLS 15 16 #include <libintl.h> 17 #define _(String) glib_gettext(String) 18 /* Split out this in the code, but keep it in the same domain for now */ 19 #define P_(String) glib_gettext(String) 20 #define C_(Context,String) glib_pgettext (Context "\004" String, strlen (Context) + 1) 21 22 #ifdef gettext_noop 23 #define N_(String) gettext_noop(String) 24 #else 25 #define N_(String) (String) 26 #endif 27 #else /* NLS is disabled */ 28 #define _(String) (String) 29 #define N_(String) (String) 30 #define P_(String) (String) 31 #define C_(Context,String) (String) 32 #define textdomain(String) ((String) ? (String) : "messages") 33 #define gettext(String) (String) 34 #define dgettext(Domain,String) (String) 35 #define dcgettext(Domain,String,Type) (String) 36 #define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2)) 37 #define bindtextdomain(Domain,Directory) (Domain) 38 #define bind_textdomain_codeset(Domain,Codeset) 39 #endif 40 41 /* not really I18N-related, but also a string marker macro */ 42 #define I_(string) g_intern_static_string (string) 43 44 #endif /* __GLIBINTL_H__ */ 45