i18n: git-describe basic messages
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
e41f1cb36b71485715941c2abe67d3e184baf061
2 files changed
+19
-19
builtin/describe.c
+18
-18
@@ -231,13 +231,13 @@ static void display_name(struct commit_name *n)
231
if (n->prio == 2 && !n->tag) {
232
n->tag = lookup_tag(n->sha1);
233
if (!n->tag || parse_tag(n->tag))
234
- die("annotated tag %s not available", n->path);
234
+ die(_("annotated tag %s not available"), n->path);
235
}
236
if (n->tag && !n->name_checked) {
237
if (!n->tag->tag)
238
- die("annotated tag %s has no embedded name", n->path);
238
+ die(_("annotated tag %s has no embedded name"), n->path);
239
if (strcmp(n->tag->tag, all ? n->path + 5 : n->path))
240
- warning("tag '%s' is really '%s' here", n->tag->tag, n->path);
240
+ warning(_("tag '%s' is really '%s' here"), n->tag->tag, n->path);
241
n->name_checked = 1;
242
}
243
@@ -264,10 +264,10 @@ static void describe(const char *arg, int last_one)
264
unsigned int unannotated_cnt = 0;
265
266
if (get_sha1(arg, sha1))
267
- die("Not a valid object name %s", arg);
267
+ die(_("Not a valid object name %s"), arg);
268
cmit = lookup_commit_reference(sha1);
269
if (!cmit)
270
- die("%s is not a valid '%s' object", arg, commit_type);
270
+ die(_("%s is not a valid '%s' object"), arg, commit_type);
271
272
n = find_commit_name(cmit->object.sha1);
273
if (n && (tags || all || n->prio == 2)) {
@@ -284,9 +284,9 @@ static void describe(const char *arg, int last_one)
284
}
285
286
if (!max_candidates)
287
- die("no tag exactly matches '%s'", sha1_to_hex(cmit->object.sha1));
287
+ die(_("no tag exactly matches '%s'"), sha1_to_hex(cmit->object.sha1));
288
if (debug)
289
- fprintf(stderr, "searching to describe %s\n", arg);
289
+ fprintf(stderr, _("searching to describe %s\n"), arg);
290
291
if (!have_util) {
292
for_each_hash(&names, set_util);
@@ -326,7 +326,7 @@ static void describe(const char *arg, int last_one)
326
}
327
if (annotated_cnt && !list) {
328
if (debug)
329
- fprintf(stderr, "finished search at %s\n",
329
+ fprintf(stderr, _("finished search at %s\n"),
330
sha1_to_hex(c->object.sha1));
331
break;
332
}
@@ -350,12 +350,12 @@ static void describe(const char *arg, int last_one)
350
return;
351
}
352
if (unannotated_cnt)
353
- die("No annotated tags can describe '%s'.\n"
354
- "However, there were unannotated tags: try --tags.",
353
+ die(_("No annotated tags can describe '%s'.\n"
354
+ "However, there were unannotated tags: try --tags."),
355
sha1_to_hex(sha1));
356
else
357
- die("No tags can describe '%s'.\n"
358
- "Try --always, or create some tags.",
357
+ die(_("No tags can describe '%s'.\n"
358
+ "Try --always, or create some tags."),
359
sha1_to_hex(sha1));
360
}
361
@@ -375,11 +375,11 @@ static void describe(const char *arg, int last_one)
375
prio_names[t->name->prio],
376
t->depth, t->name->path);
377
}
378
- fprintf(stderr, "traversed %lu commits\n", seen_commits);
378
+ fprintf(stderr, _("traversed %lu commits\n"), seen_commits);
379
if (gave_up_on) {
380
fprintf(stderr,
381
- "more than %i tags found; listed %i most recent\n"
382
- "gave up search at %s\n",
381
+ _("more than %i tags found; listed %i most recent\n"
382
+ "gave up search at %s\n"),
383
max_candidates, max_candidates,
384
sha1_to_hex(gave_up_on->object.sha1));
385
}
@@ -429,7 +429,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
429
save_commit_buffer = 0;
430
431
if (longformat && abbrev == 0)
432
- die("--long is incompatible with --abbrev=0");
432
+ die(_("--long is incompatible with --abbrev=0"));
433
434
if (contains) {
435
const char **args = xmalloc((7 + argc) * sizeof(char *));
@@ -455,14 +455,14 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
455
init_hash(&names);
456
for_each_rawref(get_name, NULL);
457
if (!names.nr && !always)
458
- die("No names found, cannot describe anything.");
458
+ die(_("No names found, cannot describe anything."));
459
460
if (argc == 0) {
461
if (dirty && !cmd_diff_index(ARRAY_SIZE(diff_index_args) - 1, diff_index_args, prefix))
462
dirty = NULL;
463
describe("HEAD", 1);
464
} else if (dirty) {
465
- die("--dirty is incompatible with committishes");
465
+ die(_("--dirty is incompatible with committishes"));
466
} else {
467
while (argc-- > 0) {
468
describe(*argv++, argc == 0);
t/t6120-describe.sh
+1
-1
@@ -123,7 +123,7 @@ cat - >err.expect <<EOF
123
warning: tag 'A' is really 'Q' here
124
EOF
125
check_describe A-* HEAD
126
-test_expect_success 'warning was displayed for Q' '
126
+test_expect_success C_LOCALE_OUTPUT 'warning was displayed for Q' '
127
test_cmp err.expect err.actual
128
'
129
test_expect_success 'rename tag Q back to A' '