]> Pileus Git - ~andy/git/commitdiff
i18n: git-fetch formatting messages
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 22 Feb 2011 23:41:52 +0000 (23:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Mar 2011 07:52:54 +0000 (23:52 -0800)
Translate some of the formatting messages that appear on git-fetch
showing how branches/tags etc. were updated.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
t/t5526-fetch-submodules.sh

index c27c3e9cc512a2a19c005728e94edbab66fa305e..0a73dffb8daf7345e536c481fb433fb59b108aba 100644 (file)
@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,
        if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
                if (verbosity > 0)
                        sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
-                               "[up to date]", REFCOL_WIDTH, remote,
+                               _("[up to date]"), REFCOL_WIDTH, remote,
                                pretty_ref);
                return 0;
        }
@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,
                 * If this is the head, and it's not okay to update
                 * the head, and the old value of the head isn't empty...
                 */
-               sprintf(display, "! %-*s %-*s -> %s  (can't fetch in current branch)",
-                       TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
+               sprintf(display, _("! %-*s %-*s -> %s  (can't fetch in current branch)"),
+                       TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
                        pretty_ref);
                return 1;
        }
@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,
                int r;
                r = s_update_ref("updating tag", ref, 0);
                sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
-                       TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
-                       pretty_ref, r ? "  (unable to update local ref)" : "");
+                       TRANSPORT_SUMMARY_WIDTH, _("[tag update]"), REFCOL_WIDTH, remote,
+                       pretty_ref, r ? _("  (unable to update local ref)") : "");
                return r;
        }
 
@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
                                 REFCOL_WIDTH, *what ? what : "HEAD");
                if (*note) {
                        if (verbosity >= 0 && !shown_url) {
-                               fprintf(stderr, "From %.*s\n",
+                               fprintf(stderr, _("From %.*s\n"),
                                                url_len, url);
                                shown_url = 1;
                        }
@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
        int result = 0;
        struct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);
        const char *dangling_msg = dry_run
-               ? "   (%s will become dangling)\n"
-               : "   (%s has become dangling)\n";
+               ? _("   (%s will become dangling)\n")
+               : _("   (%s has become dangling)\n");
 
        for (ref = stale_refs; ref; ref = ref->next) {
                if (!dry_run)
                        result |= delete_ref(ref->name, NULL, 0);
                if (verbosity >= 0) {
                        fprintf(stderr, " x %-*s %-*s -> %s\n",
-                               TRANSPORT_SUMMARY_WIDTH, "[deleted]",
-                               REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
+                               TRANSPORT_SUMMARY_WIDTH, _("[deleted]"),
+                               REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name));
                        warn_dangling_symref(stderr, dangling_msg, ref->name);
                }
        }
index a5f458533fd071c13550a72bf251e2e10c109637..8f1237987944b6b7e59b2b24ed785daf3cbba040 100755 (executable)
@@ -66,7 +66,10 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "fetch --recurse-submodules recurses into submodules: output" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '
@@ -95,7 +98,10 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
                cd downstream &&
                git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
                git fetch >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '
@@ -126,7 +132,10 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
                git fetch --recurse-submodules >../actual.out 2>../actual.err &&
                git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
                git config --unset submodule.submodule.fetchRecurseSubmodules
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '
@@ -145,13 +154,22 @@ test_expect_success "--dry-run propagates to submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "--dry-run propagates to submodules: output" '
        test_cmp expect.out actual.out &&
-       test_cmp expect.err actual.err &&
+       test_cmp expect.err actual.err
+'
+
+test_expect_success "Without --dry-run propagates to submodules" '
        (
                cd downstream &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "Without --dry-run propagates to submodules: output" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '
@@ -162,7 +180,10 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
                cd downstream &&
                git config fetch.recurseSubmodules true
                git fetch >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "recurseSubmodules=true propagates into submodules: output" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '
@@ -176,7 +197,10 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
                        git config fetch.recurseSubmodules false
                ) &&
                git fetch --recurse-submodules >../actual.out 2>../actual.err
-       ) &&
+       )
+'
+
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides config in submodule: output" '
        test_cmp expect.out actual.out &&
        test_cmp expect.err actual.err
 '