From 996214e9a12bbf49f0e5110e992a37193b31c71e Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 2 Sep 2010 18:55:40 +0000 Subject: [PATCH] gettextize: git-tag tag_template message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Mark the tag_template message as translatable with N_() and then use it later with _(). We need to skip a test under GETTEXT_POISON that relies on the output having a leading newline. Signed-off-by: Ævar Arnfjörð Bjarmason --- builtin/tag.c | 6 +++--- t/t7004-tag.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index 0baa2079a..9da762cbf 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -215,10 +215,10 @@ static int do_sign(struct strbuf *buffer) } static const char tag_template[] = - "\n" + N_("\n" "#\n" "# Write a tag message\n" - "#\n"; + "#\n"); static void set_signingkey(const char *value) { @@ -313,7 +313,7 @@ static void create_tag(const unsigned char *object, const char *tag, if (!is_null_sha1(prev)) write_tag_body(fd, prev); else - write_or_die(fd, tag_template, strlen(tag_template)); + write_or_die(fd, _(tag_template), strlen(_(tag_template))); close(fd); if (launch_editor(path, buf, NULL)) { diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh index 700b556fe..99e867730 100755 --- a/t/t7004-tag.sh +++ b/t/t7004-tag.sh @@ -1055,6 +1055,7 @@ test_expect_success \ ' test_expect_success \ + NO_GETTEXT_POISON \ 'message in editor has initial comment: first line' ' # check the first line --- should be empty echo >first.expect && -- 2.30.2