i18n: git-fetch formatting messages
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>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:41 UTC
502681cd7dcf87e067eba61da176388467606a2c
2 files changed
+42
-18
builtin/fetch.c
+10
-10
@@ -242,7 +242,7 @@ static int update_local_ref(struct ref *ref,
242
if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
243
if (verbosity > 0)
244
sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
245
- "[up to date]", REFCOL_WIDTH, remote,
245
+ _("[up to date]"), REFCOL_WIDTH, remote,
246
pretty_ref);
247
return 0;
248
}
@@ -255,8 +255,8 @@ static int update_local_ref(struct ref *ref,
255
* If this is the head, and it's not okay to update
256
* the head, and the old value of the head isn't empty...
257
*/
258
- sprintf(display, "! %-*s %-*s -> %s (can't fetch in current branch)",
259
- TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
258
+ sprintf(display, _("! %-*s %-*s -> %s (can't fetch in current branch)"),
259
+ TRANSPORT_SUMMARY_WIDTH, _("[rejected]"), REFCOL_WIDTH, remote,
260
pretty_ref);
261
return 1;
262
}
@@ -266,8 +266,8 @@ static int update_local_ref(struct ref *ref,
266
int r;
267
r = s_update_ref("updating tag", ref, 0);
268
sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
269
- TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
270
- pretty_ref, r ? " (unable to update local ref)" : "");
269
+ TRANSPORT_SUMMARY_WIDTH, _("[tag update]"), REFCOL_WIDTH, remote,
270
+ pretty_ref, r ? _(" (unable to update local ref)") : "");
271
return r;
272
}
273
@@ -415,7 +415,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
415
REFCOL_WIDTH, *what ? what : "HEAD");
416
if (*note) {
417
if (verbosity >= 0 && !shown_url) {
418
- fprintf(stderr, "From %.*s\n",
418
+ fprintf(stderr, _("From %.*s\n"),
419
url_len, url);
420
shown_url = 1;
421
}
@@ -524,16 +524,16 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
524
int result = 0;
525
struct ref *ref, *stale_refs = get_stale_heads(transport->remote, ref_map);
526
const char *dangling_msg = dry_run
527
- ? " (%s will become dangling)\n"
528
- : " (%s has become dangling)\n";
527
+ ? _(" (%s will become dangling)\n")
528
+ : _(" (%s has become dangling)\n");
529
530
for (ref = stale_refs; ref; ref = ref->next) {
531
if (!dry_run)
532
result |= delete_ref(ref->name, NULL, 0);
533
if (verbosity >= 0) {
534
fprintf(stderr, " x %-*s %-*s -> %s\n",
535
- TRANSPORT_SUMMARY_WIDTH, "[deleted]",
536
- REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
535
+ TRANSPORT_SUMMARY_WIDTH, _("[deleted]"),
536
+ REFCOL_WIDTH, _("(none)"), prettify_refname(ref->name));
537
warn_dangling_symref(stderr, dangling_msg, ref->name);
538
}
539
}
t/t5526-fetch-submodules.sh
+32
-8
@@ -66,7 +66,10 @@ test_expect_success "fetch --recurse-submodules recurses into submodules" '
66
(
67
cd downstream &&
68
git fetch --recurse-submodules >../actual.out 2>../actual.err
69
- ) &&
69
+ )
70
+'
71
+
72
+test_expect_success C_LOCALE_OUTPUT "fetch --recurse-submodules recurses into submodules: output" '
73
test_cmp expect.out actual.out &&
74
test_cmp expect.err actual.err
75
'
@@ -95,7 +98,10 @@ test_expect_success "using fetchRecurseSubmodules=true in .gitmodules recurses i
98
cd downstream &&
99
git config -f .gitmodules submodule.submodule.fetchRecurseSubmodules true &&
100
git fetch >../actual.out 2>../actual.err
98
- ) &&
101
+ )
102
+'
103
+
104
+test_expect_success C_LOCALE_OUTPUT "using fetchRecurseSubmodules=true in .gitmodules recurses into submodules" '
105
test_cmp expect.out actual.out &&
106
test_cmp expect.err actual.err
107
'
@@ -126,7 +132,10 @@ test_expect_success "--recurse-submodules overrides fetchRecurseSubmodules setti
132
git fetch --recurse-submodules >../actual.out 2>../actual.err &&
133
git config --unset -f .gitmodules submodule.submodule.fetchRecurseSubmodules &&
134
git config --unset submodule.submodule.fetchRecurseSubmodules
129
- ) &&
135
+ )
136
+'
137
+
138
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides fetchRecurseSubmodules setting from .git/config: output" '
139
test_cmp expect.out actual.out &&
140
test_cmp expect.err actual.err
141
'
@@ -145,13 +154,22 @@ test_expect_success "--dry-run propagates to submodules" '
154
(
155
cd downstream &&
156
git fetch --recurse-submodules --dry-run >../actual.out 2>../actual.err
148
- ) &&
157
+ )
158
+'
159
+
160
+test_expect_success C_LOCALE_OUTPUT "--dry-run propagates to submodules: output" '
161
test_cmp expect.out actual.out &&
150
- test_cmp expect.err actual.err &&
162
+ test_cmp expect.err actual.err
163
+'
164
+
165
+test_expect_success "Without --dry-run propagates to submodules" '
166
(
167
cd downstream &&
168
git fetch --recurse-submodules >../actual.out 2>../actual.err
154
- ) &&
169
+ )
170
+'
171
+
172
+test_expect_success C_LOCALE_OUTPUT "Without --dry-run propagates to submodules: output" '
173
test_cmp expect.out actual.out &&
174
test_cmp expect.err actual.err
175
'
@@ -162,7 +180,10 @@ test_expect_success "recurseSubmodules=true propagates into submodules" '
180
cd downstream &&
181
git config fetch.recurseSubmodules true
182
git fetch >../actual.out 2>../actual.err
165
- ) &&
183
+ )
184
+'
185
+
186
+test_expect_success C_LOCALE_OUTPUT "recurseSubmodules=true propagates into submodules: output" '
187
test_cmp expect.out actual.out &&
188
test_cmp expect.err actual.err
189
'
@@ -176,7 +197,10 @@ test_expect_success "--recurse-submodules overrides config in submodule" '
197
git config fetch.recurseSubmodules false
198
) &&
199
git fetch --recurse-submodules >../actual.out 2>../actual.err
179
- ) &&
200
+ )
201
+'
202
+
203
+test_expect_success C_LOCALE_OUTPUT "--recurse-submodules overrides config in submodule: output" '
204
test_cmp expect.out actual.out &&
205
test_cmp expect.err actual.err
206
'