Tizen 2.1 base
[platform/upstream/glib2.0.git] / glib / glibintl.h
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 const gchar * glib_gettext  (const gchar *str) G_GNUC_FORMAT(1);
9 const gchar * glib_pgettext (const gchar *msgctxtid,
10                              gsize        msgidoffset) G_GNUC_FORMAT(1);
11
12 #ifdef ENABLE_NLS
13
14 #include <libintl.h>
15 #define _(String) glib_gettext(String)
16 /* Split out this in the code, but keep it in the same domain for now */
17 #define P_(String) glib_gettext(String)
18 #define C_(Context,String) glib_pgettext (Context "\004" String, strlen (Context) + 1)
19
20 #ifdef gettext_noop
21 #define N_(String) gettext_noop(String)
22 #else
23 #define N_(String) (String)
24 #endif
25 #else /* NLS is disabled */
26 #define _(String) (String)
27 #define N_(String) (String)
28 #define P_(String) (String)
29 #define C_(Context,String) (String)
30 #define textdomain(String) ((String) ? (String) : "messages")
31 #define gettext(String) (String)
32 #define dgettext(Domain,String) (String)
33 #define dcgettext(Domain,String,Type) (String)
34 #define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2))
35 #define bindtextdomain(Domain,Directory) (Domain) 
36 #define bind_textdomain_codeset(Domain,Codeset)
37 #endif
38
39 /* not really I18N-related, but also a string marker macro */
40 #define I_(string) g_intern_static_string (string)
41
42 #endif /* __GLIBINTL_H__ */