summaryrefslogtreecommitdiff
path: root/glib/glibintl.h
blob: 4f2e58b80e3e1a35a8ed335611feb4853466329f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __GLIBINTL_H__
#define __GLIBINTL_H__

#ifndef SIZEOF_CHAR
#error "config.h must be included prior to glibintl.h"
#endif

GLIB_AVAILABLE_IN_ALL
const gchar * glib_gettext  (const gchar *str) G_GNUC_FORMAT(1);
GLIB_AVAILABLE_IN_ALL
const gchar * glib_pgettext (const gchar *msgctxtid,
                             gsize        msgidoffset) G_GNUC_FORMAT(1);

#ifdef ENABLE_NLS

#include <libintl.h>
#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)
#define C_(Context,String) glib_pgettext (Context "\004" String, strlen (Context) + 1)

#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)
#define P_(String) (String)
#define C_(Context,String) (String)
#define textdomain(String) ((String) ? (String) : "messages")
#define gettext(String) (String)
#define dgettext(Domain,String) (String)
#define dcgettext(Domain,String,Type) (String)
#define dngettext(Domain,String1,String2,N) ((N) == 1 ? (String1) : (String2))
#define bindtextdomain(Domain,Directory) (Domain) 
#define bind_textdomain_codeset(Domain,Codeset)
#endif

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

#endif /* __GLIBINTL_H__ */