glibintl.h 1.33 KB
Newer Older
Owen Taylor's avatar
Owen Taylor committed
1 2 3
#ifndef __GLIBINTL_H__
#define __GLIBINTL_H__

Owen Taylor's avatar
1.3.14  
Owen Taylor committed
4 5 6
#ifndef SIZEOF_CHAR
#error "config.h must be included prior to glibintl.h"
#endif
Owen Taylor's avatar
Owen Taylor committed
7

8 9 10
const gchar * glib_gettext  (const gchar *str) G_GNUC_FORMAT(1);
const gchar * glib_pgettext (const gchar *msgctxtid,
                             gsize        msgidoffset) G_GNUC_FORMAT(1);
Owen Taylor's avatar
Owen Taylor committed
11

Alexander Larsson's avatar
Alexander Larsson committed
12
#ifdef ENABLE_NLS
Owen Taylor's avatar
Owen Taylor committed
13

14
#include <libintl.h>
15 16 17
#define _(String) glib_gettext(String)
/* Split out this in the code, but keep it in the same domain for now */
#define P_(String) glib_gettext(String)
18
#define C_(Context,String) glib_pgettext (Context "\004" String, strlen (Context) + 1)
Owen Taylor's avatar
Owen Taylor committed
19 20 21 22 23 24 25 26 27

#ifdef gettext_noop
#define N_(String) gettext_noop(String)
#else
#define N_(String) (String)
#endif
#else /* NLS is disabled */
#define _(String) (String)
#define N_(String) (String)
28
#define P_(String) (String)
Emmanuele Bassi's avatar
Emmanuele Bassi committed
29
#define C_(Context,String) (String)
30
#define textdomain(String) ((String) ? (String) : "messages")
Owen Taylor's avatar
Owen Taylor committed
31 32 33
#define gettext(String) (String)
#define dgettext(Domain,String) (String)
#define dcgettext(Domain,String,Type) (String)
34
#define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2))
Owen Taylor's avatar
Owen Taylor committed
35
#define bindtextdomain(Domain,Directory) (Domain) 
36
#define bind_textdomain_codeset(Domain,Codeset)
Owen Taylor's avatar
Owen Taylor committed
37 38
#endif

39 40 41
/* not really I18N-related, but also a string marker macro */
#define I_(string) g_intern_static_string (string)

Owen Taylor's avatar
Owen Taylor committed
42
#endif /* __GLIBINTL_H__ */