Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2011-02-23 02:41:20 +0300
committerJunio C Hamano <gitster@pobox.com>2011-03-08 23:10:03 +0300
commit6578483036695820d05aa7cf482a38169ad321bf (patch)
treeb45c310a25416f9b6d9cef7a503723b7f6a007f9 /cache.h
parent098d0e0e8e7467bea5306d5bc98b283bfe0174fb (diff)
i18n: add no-op _() and N_() wrappers
The _ function is for translating strings into the user's chosen language. The N_ macro just marks translatable strings for the xgettext(1) tool without translating them; it is intended for use in contexts where a function call cannot be used. So, for example: fprintf(stderr, _("Expansion of alias '%s' failed; " "'%s' is not a git command\n"), cmd, argv[0]); and const char *unpack_plumbing_errors[NB_UNPACK_TREES_ERROR_TYPES] = { /* ERROR_WOULD_OVERWRITE */ N_("Entry '%s' would be overwritten by merge. Cannot merge."), [...] Define such _ and N_ in a new gettext.h and include it in cache.h, so they can be used everywhere. Each just returns its argument for now. _ is a function rather than a macro like N_ to avoid the temptation to use _("foo") as a string literal (which would be a compile-time error once _(s) expands to an expression for the translation of s). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
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