i18n: git-log 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:41 UTC
5c5f1d7ce116b945ad74b4ae67ae36a2ddeb610c
1 file changed
+31
-31
builtin/log.c
+31
-31
@@ -101,7 +101,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
101
const char *v = skip_prefix(arg, "--decorate=");
102
decoration_style = parse_decoration_style(arg, v);
103
if (decoration_style < 0)
104
- die("invalid --decorate option: %s", arg);
104
+ die(_("invalid --decorate option: %s"), arg);
105
decoration_given = 1;
106
} else if (!strcmp(arg, "--no-decorate")) {
107
decoration_style = 0;
@@ -110,7 +110,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
110
} else if (!strcmp(arg, "-h")) {
111
usage(builtin_log_usage);
112
} else
113
- die("unrecognized argument: %s", arg);
113
+ die(_("unrecognized argument: %s"), arg);
114
}
115
116
/*
@@ -153,7 +153,7 @@ static void show_early_header(struct rev_info *rev, const char *stage, int nr)
153
if (rev->commit_format != CMIT_FMT_ONELINE)
154
putchar(rev->diffopt.line_termination);
155
}
156
- printf("Final output: %d %s\n", nr, stage);
156
+ printf(_("Final output: %d %s\n"), nr, stage);
157
}
158
159
static struct itimerval early_output_timer;
@@ -252,7 +252,7 @@ static int cmd_log_walk(struct rev_info *rev)
252
setup_early_output(rev);
253
254
if (prepare_revision_walk(rev))
255
- die("revision walk setup failed");
255
+ die(_("revision walk setup failed"));
256
257
if (rev->early_output)
258
finish_early_output(rev);
@@ -343,7 +343,7 @@ static int show_object(const unsigned char *sha1, int show_tag_object,
343
int offset = 0;
344
345
if (!buf)
346
- return error("Could not read object %s", sha1_to_hex(sha1));
346
+ return error(_("Could not read object %s"), sha1_to_hex(sha1));
347
348
if (show_tag_object)
349
while (offset < size && buf[offset] != '\n') {
@@ -430,7 +430,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
430
break;
431
o = parse_object(t->tagged->sha1);
432
if (!o)
433
- ret = error("Could not read object %s",
433
+ ret = error(_("Could not read object %s"),
434
sha1_to_hex(t->tagged->sha1));
435
objects[i].item = o;
436
i--;
@@ -454,7 +454,7 @@ int cmd_show(int argc, const char **argv, const char *prefix)
454
ret = cmd_log_walk(&rev);
455
break;
456
default:
457
- ret = error("Unknown type: %d", o->type);
457
+ ret = error(_("Unknown type: %d"), o->type);
458
}
459
}
460
free(objects);
@@ -554,7 +554,7 @@ static int git_format_config(const char *var, const char *value, void *cb)
554
{
555
if (!strcmp(var, "format.headers")) {
556
if (!value)
557
- die("format.headers without value");
557
+ die(_("format.headers without value"));
558
add_header(value);
559
return 0;
560
}
@@ -626,7 +626,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
626
strbuf_addstr(&filename, output_directory);
627
if (filename.len >=
628
PATH_MAX - FORMAT_PATCH_NAME_MAX - suffix_len)
629
- return error("name of output directory is too long");
629
+ return error(_("name of output directory is too long"));
630
if (filename.buf[filename.len - 1] != '/')
631
strbuf_addch(&filename, '/');
632
}
@@ -637,7 +637,7 @@ static int reopen_stdout(struct commit *commit, struct rev_info *rev)
637
fprintf(realstdout, "%s\n", filename.buf + outdir_offset);
638
639
if (freopen(filename.buf, "w", stdout) == NULL)
640
- return error("Cannot open patch file %s", filename.buf);
640
+ return error(_("Cannot open patch file %s"), filename.buf);
641
642
strbuf_release(&filename);
643
return 0;
@@ -651,7 +651,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
651
unsigned flags1, flags2;
652
653
if (rev->pending.nr != 2)
654
- die("Need exactly one range.");
654
+ die(_("Need exactly one range."));
655
656
o1 = rev->pending.objects[0].item;
657
flags1 = o1->flags;
@@ -659,7 +659,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
659
flags2 = o2->flags;
660
661
if ((flags1 & UNINTERESTING) == (flags2 & UNINTERESTING))
662
- die("Not a range.");
662
+ die(_("Not a range."));
663
664
init_patch_ids(ids);
665
@@ -670,7 +670,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
670
add_pending_object(&check_rev, o1, "o1");
671
add_pending_object(&check_rev, o2, "o2");
672
if (prepare_revision_walk(&check_rev))
673
- die("revision walk setup failed");
673
+ die(_("revision walk setup failed"));
674
675
while ((commit = get_revision(&check_rev)) != NULL) {
676
/* ignore merges */
@@ -696,7 +696,7 @@ static void gen_message_id(struct rev_info *info, char *base)
696
const char *email_end = strrchr(committer, '>');
697
struct strbuf buf = STRBUF_INIT;
698
if (!email_start || !email_end || email_start > email_end - 1)
699
- die("Could not extract email from committer identity.");
699
+ die(_("Could not extract email from committer identity."));
700
strbuf_addf(&buf, "%s.%lu.git.%.*s", base,
701
(unsigned long) time(NULL),
702
(int)(email_end - email_start - 1), email_start + 1);
@@ -728,7 +728,7 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
728
struct commit *commit = NULL;
729
730
if (rev->commit_format != CMIT_FMT_EMAIL)
731
- die("Cover letter needs email format");
731
+ die(_("Cover letter needs email format"));
732
733
committer = git_committer_info(0);
734
@@ -821,7 +821,7 @@ static const char *clean_message_id(const char *msg_id)
821
m++;
822
}
823
if (!z)
824
- die("insane in-reply-to: %s", msg_id);
824
+ die(_("insane in-reply-to: %s"), msg_id);
825
if (++z == m)
826
return a;
827
return xmemdupz(a, z - a);
@@ -894,7 +894,7 @@ static int output_directory_callback(const struct option *opt, const char *arg,
894
{
895
const char **dir = (const char **)opt->value;
896
if (*dir)
897
- die("Two output directories?");
897
+ die(_("Two output directories?"));
898
*dir = arg;
899
return 0;
900
}
@@ -1082,7 +1082,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1082
committer = git_committer_info(IDENT_ERROR_ON_NO_NAME);
1083
endpos = strchr(committer, '>');
1084
if (!endpos)
1085
- die("bogus committer info %s", committer);
1085
+ die(_("bogus committer info %s"), committer);
1086
add_signoff = xmemdupz(committer, endpos - committer + 1);
1087
}
1088
@@ -1127,13 +1127,13 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1127
numbered = 0;
1128
1129
if (numbered && keep_subject)
1130
- die ("-n and -k are mutually exclusive.");
1130
+ die (_("-n and -k are mutually exclusive."));
1131
if (keep_subject && subject_prefix)
1132
- die ("--subject-prefix and -k are mutually exclusive.");
1132
+ die (_("--subject-prefix and -k are mutually exclusive."));
1133
1134
argc = setup_revisions(argc, argv, &rev, &s_r_opt);
1135
if (argc > 1)
1136
- die ("unrecognized argument: %s", argv[1]);
1136
+ die (_("unrecognized argument: %s"), argv[1]);
1137
1138
if (rev.diffopt.output_format & DIFF_FORMAT_NAME)
1139
die("--name-only does not make sense");
@@ -1163,9 +1163,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1163
1164
if (output_directory) {
1165
if (use_stdout)
1166
- die("standard output, or directory, which one?");
1166
+ die(_("standard output, or directory, which one?"));
1167
if (mkdir(output_directory, 0777) < 0 && errno != EEXIST)
1168
- die_errno("Could not create directory '%s'",
1168
+ die_errno(_("Could not create directory '%s'"),
1169
output_directory);
1170
}
1171
@@ -1219,7 +1219,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1219
realstdout = xfdopen(xdup(1), "w");
1220
1221
if (prepare_revision_walk(&rev))
1222
- die("revision walk setup failed");
1222
+ die(_("revision walk setup failed"));
1223
rev.boundary = 1;
1224
while ((commit = get_revision(&rev)) != NULL) {
1225
if (commit->object.flags & BOUNDARY) {
@@ -1300,7 +1300,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
1300
1301
if (!use_stdout && reopen_stdout(numbered_files ? NULL : commit,
1302
&rev))
1303
- die("Failed to create output files");
1303
+ die(_("Failed to create output files"));
1304
shown = log_tree_commit(&rev, commit);
1305
free(commit->buffer);
1306
commit->buffer = NULL;
@@ -1387,9 +1387,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
1387
if (!current_branch || !current_branch->merge
1388
|| !current_branch->merge[0]
1389
|| !current_branch->merge[0]->dst) {
1390
- fprintf(stderr, "Could not find a tracked"
1390
+ fprintf(stderr, _("Could not find a tracked"
1391
" remote branch, please"
1392
- " specify <upstream> manually.\n");
1392
+ " specify <upstream> manually.\n"));
1393
usage_with_options(cherry_usage, options);
1394
}
1395
@@ -1403,9 +1403,9 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
1403
DIFF_OPT_SET(&revs.diffopt, RECURSIVE);
1404
1405
if (add_pending_commit(head, &revs, 0))
1406
- die("Unknown commit %s", head);
1406
+ die(_("Unknown commit %s"), head);
1407
if (add_pending_commit(upstream, &revs, UNINTERESTING))
1408
- die("Unknown commit %s", upstream);
1408
+ die(_("Unknown commit %s"), upstream);
1409
1410
/* Don't say anything if head and upstream are the same. */
1411
if (revs.pending.nr == 2) {
@@ -1417,11 +1417,11 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
1417
get_patch_ids(&revs, &ids, prefix);
1418
1419
if (limit && add_pending_commit(limit, &revs, UNINTERESTING))
1420
- die("Unknown commit %s", limit);
1420
+ die(_("Unknown commit %s"), limit);
1421
1422
/* reverse the list of commits */
1423
if (prepare_revision_walk(&revs))
1424
- die("revision walk setup failed");
1424
+ die(_("revision walk setup failed"));
1425
while ((commit = get_revision(&revs)) != NULL) {
1426
/* ignore merges */
1427
if (commit->parents && commit->parents->next)