From 646c3bd1ad59ab4aea2718d89c8eb9ce8cfa83bf Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 27 Mar 2017 18:50:05 +0200 Subject: [PATCH 1/2] describe: localize debug output fully git describe --debug localizes all debug messages but not the terms head, lightweight, annotated that it outputs for the candidates. Localize them, too. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/describe.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/builtin/describe.c b/builtin/describe.c index 45adbf67d5..a5cd8c513f 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -50,7 +50,7 @@ struct commit_name { }; static const char *prio_names[] = { - "head", "lightweight", "annotated", + N_("head"), N_("lightweight"), N_("annotated"), }; static int commit_name_cmp(const struct commit_name *cn1, @@ -395,10 +395,19 @@ static void describe(const char *arg, int last_one) free_commit_list(list); if (debug) { + static int label_width = -1; + if (label_width < 0) { + int i, w; + for (i = 0; i < ARRAY_SIZE(prio_names); i++) { + w = strlen(_(prio_names[i])); + if (label_width < w) + label_width = w; + } + } for (cur_match = 0; cur_match < match_cnt; cur_match++) { struct possible_tag *t = &all_matches[cur_match]; - fprintf(stderr, " %-11s %8d %s\n", - prio_names[t->name->prio], + fprintf(stderr, " %-*s %8d %s\n", + label_width, _(prio_names[t->name->prio]), t->depth, t->name->path); } fprintf(stderr, _("traversed %lu commits\n"), seen_commits); From 7d5a38b61fad51b765117ae6dae9117db74dac3d Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 27 Mar 2017 18:50:06 +0200 Subject: [PATCH 2/2] l10n: de: translate describe debug terms Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- po/de.po | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/po/de.po b/po/de.po index e9c86f5488..913db393dc 100644 --- a/po/de.po +++ b/po/de.po @@ -7530,7 +7530,19 @@ msgstr "git describe [] [...]" msgid "git describe [] --dirty" msgstr "git describe [] --dirty" -#: builtin/describe.c:217 +#: builtin/describe.c:52 +msgid "head" +msgstr "Branch" + +#: builtin/describe.c:52 +msgid "lightweight" +msgstr "nicht-annotiert" + +#: builtin/describe.c:52 +msgid "annotated" +msgstr "annotiert" + +#: builtin/describe.c:249 #, c-format msgid "annotated tag %s not available" msgstr "annotiertes Tag %s ist nicht verfügbar"