summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--cache.h1
-rw-r--r--gettext.h26
3 files changed, 28 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ade79232f4..c153f450c5 100644
--- a/Makefile
+++ b/Makefile
@@ -515,6 +515,7 @@ LIB_H += diff.h
LIB_H += dir.h
LIB_H += exec_cmd.h
LIB_H += fsck.h
+LIB_H += gettext.h
LIB_H += git-compat-util.h
LIB_H += graph.h
LIB_H += grep.h
diff --git a/cache.h b/cache.h
index 4a758babec..8188169ac6 100644
--- a/cache.h
+++ b/cache.h
@@ -5,6 +5,7 @@
#include "strbuf.h"
#include "hash.h"
#include "advice.h"
+#include "gettext.h"
#include SHA1_HEADER
#ifndef git_SHA_CTX
diff --git a/gettext.h b/gettext.h
new file mode 100644
index 0000000000..6949d736d5
--- /dev/null
+++ b/gettext.h
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2010-2011 Ævar Arnfjörð Bjarmason
+ *
+ * This is a skeleton no-op implementation of gettext for Git.
+ * You can replace it with something that uses libintl.h and wraps
+ * gettext() to try out the translations.
+ */
+
+#ifndef GETTEXT_H
+#define GETTEXT_H
+
+#ifdef _
+#error "namespace conflict: '_' is pre-defined?"
+#endif
+
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
+{
+ return msgid;
+}
+
+/* Mark msgid for translation but do not translate it. */
+#define N_(msgid) (msgid)
+
+#endif