mktag: mark strings for translation

Mark the errors mktag might emit for translation. This is a plumbing command, but the errors it emits are intended to be human-readable. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Jan 5, 2021 at 20:42 UTC 2aa9425fbeb58f459240f223525e512499ab62e4
1 file changed +8 -8
builtin/mktag.c
+8 -8
@@ -31,10 +31,10 @@ static int mktag_fsck_error_func(struct fsck_options *o,
31 * like missing "tagger" lines are "only" warnings
32 * under fsck, we've always considered them an error.
33 */
34 - fprintf_ln(stderr, "error: tag input does not pass fsck: %s", message);
34 + fprintf_ln(stderr, _("error: tag input does not pass fsck: %s"), message);
35 return 1;
36 default:
37 - BUG("%d (FSCK_IGNORE?) should never trigger this callback",
37 + BUG(_("%d (FSCK_IGNORE?) should never trigger this callback"),
38 msg_type);
39 }
40 }
@@ -49,10 +49,10 @@ static int verify_object_in_tag(struct object_id *tagged_oid, int *tagged_type)
49
50 buffer = read_object_file(tagged_oid, &type, &size);
51 if (!buffer)
52 - die("could not read tagged object '%s'",
52 + die(_("could not read tagged object '%s'"),
53 oid_to_hex(tagged_oid));
54 if (type != *tagged_type)
55 - die("object '%s' tagged as '%s', but is a '%s' type",
55 + die(_("object '%s' tagged as '%s', but is a '%s' type"),
56 oid_to_hex(tagged_oid),
57 type_name(*tagged_type), type_name(type));
58
@@ -79,7 +79,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
79 builtin_mktag_usage, 0);
80
81 if (strbuf_read(&buf, 0, 0) < 0)
82 - die_errno("could not read from stdin");
82 + die_errno(_("could not read from stdin"));
83
84 fsck_options.error_func = mktag_fsck_error_func;
85 fsck_set_msg_type(&fsck_options, "extraheaderentry", "warn");
@@ -87,13 +87,13 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
87 git_config(mktag_config, NULL);
88 if (fsck_tag_standalone(NULL, buf.buf, buf.len, &fsck_options,
89 &tagged_oid, &tagged_type))
90 - die("tag on stdin did not pass our strict fsck check");
90 + die(_("tag on stdin did not pass our strict fsck check"));
91
92 if (verify_object_in_tag(&tagged_oid, &tagged_type))
93 - die("tag on stdin did not refer to a valid object");
93 + die(_("tag on stdin did not refer to a valid object"));
94
95 if (write_object_file(buf.buf, buf.len, tag_type, &result) < 0)
96 - die("unable to write tag file");
96 + die(_("unable to write tag file"));
97
98 strbuf_release(&buf);
99 puts(oid_to_hex(&result));