]> git.ipfire.org Git - thirdparty/git.git/blobdiff - gettext.h
i18n: add no-op _() and N_() wrappers
[thirdparty/git.git] / gettext.h
diff --git a/gettext.h b/gettext.h
new file mode 100644 (file)
index 0000000..6949d73
--- /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