Code

i18n: git-tag tag_template message
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 22 Feb 2011 23:42:10 +0000 (23:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Mar 2011 07:52:56 +0000 (23:52 -0800)
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>
builtin/tag.c
t/t7004-tag.sh

index 4bed7c2cf35631fb7bfb250b0ea49bcf446b1e8e..4242e271aea68c8702b61e0829f1ff40cfb7ca2e 100644 (file)
@@ -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)
 {
@@ -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)) {
index 3e7baaf89f9bada46fc084e568544ce9df833594..1dedfd0c836c06eb3d2f66aa8e4e7eac54368508 100755 (executable)
@@ -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 &&