Skip to content

Commit

Permalink
i18n: git-tag tag_template message
Browse files Browse the repository at this point in the history
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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ævar Arnfjörð Bjarmason authored and Junio C Hamano committed Mar 10, 2011
1 parent d08ebf9 commit 7fbff25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions builtin/tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,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)
{
Expand Down Expand Up @@ -305,7 +305,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)) {
Expand Down
1 change: 1 addition & 0 deletions t/t7004-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,7 @@ test_expect_success \
'

test_expect_success \
C_LOCALE_OUTPUT \
'message in editor has initial comment: first line' '
# check the first line --- should be empty
echo >first.expect &&
Expand Down

0 comments on commit 7fbff25

Please sign in to comment.