aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-i18n.h
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-i18n.h')
-rw-r--r--e-util/e-i18n.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/e-util/e-i18n.h b/e-util/e-i18n.h
new file mode 100644
index 0000000000..53e4c17155
--- /dev/null
+++ b/e-util/e-i18n.h
@@ -0,0 +1,39 @@
+/*
+ * Copied from gnome-i18nP.h, because this header is typically not installed
+ *
+ * This file has to be included before any file from the GNOME libraries
+ * to have this override the definitions that are pulled from the gnome-i18n.h
+ *
+ * the difference is that gnome-i18n.h is used for applications, and this is
+ * used by libraries (because libraries have to use dcgettext instead of
+ * gettext and they need to provide the translation domain, unlike apps).
+ *
+ * So you can just put this after you include config.h
+ */
+
+#ifndef __E_I18N_H__
+#define __E_I18N_H__
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+# undef _
+# define _(String) dgettext (PACKAGE, String)
+# ifdef gettext_noop
+# define N_(String) gettext_noop (String)
+# else
+# define N_(String) (String)
+# endif
+#else
+/* Stubs that do something close enough. */
+# define textdomain(String) (String)
+# define gettext(String) (String)
+# define dgettext(Domain,Message) (Message)
+# define dcgettext(Domain,Message,Type) (Message)
+# define bindtextdomain(Domain,Directory) (Domain)
+# define _(String) (String)
+# define N_(String) (String)
+#endif
+
+#define __GNOME_I18N_H__ 1
+
+#endif /* __E_I18N_H__ */