i18n: git-tag tag_template message
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>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:42 UTC
7fbff25a539128f9940c03c9e975aad955f7e92a
2 files changed
+4
-3
builtin/tag.c
+3
-3
@@ -213,10 +213,10 @@ static int do_sign(struct strbuf *buffer)
213
}
214
215
static const char tag_template[] =
216
- "\n"
216
+ N_("\n"
217
"#\n"
218
"# Write a tag message\n"
219
- "#\n";
219
+ "#\n");
220
221
static void set_signingkey(const char *value)
222
{
@@ -305,7 +305,7 @@ static void create_tag(const unsigned char *object, const char *tag,
305
if (!is_null_sha1(prev))
306
write_tag_body(fd, prev);
307
else
308
- write_or_die(fd, tag_template, strlen(tag_template));
308
+ write_or_die(fd, _(tag_template), strlen(_(tag_template)));
309
close(fd);
310
311
if (launch_editor(path, buf, NULL)) {
t/t7004-tag.sh
+1
@@ -1121,6 +1121,7 @@ test_expect_success \
1121
'
1122
1123
test_expect_success \
1124
+ C_LOCALE_OUTPUT \
1125
'message in editor has initial comment: first line' '
1126
# check the first line --- should be empty
1127
echo >first.expect &&