{"thread":{"id":"45409","subject":"[PATCH 2/2] l10n: de: translate describe debug terms","startedAt":"2017-03-17T15:13:36Z","lastAt":"2017-03-27T20:45:06Z","messageCount":7,"participants":["Michael J Gruber","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"314340","messageId":"faa3afab66e0cd2f3851c41415ce08aa3c53f42b.1489763302.git.git@drmicha.warpmail.net","threadId":"45409","inReplyTo":"105f48ad2ae1aa9c88ce6088e6b304294bec0835.1489763302.git.git@drmicha.warpmail.net","subject":"[PATCH 2/2] l10n: de: translate describe debug terms","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2017-03-17T15:12:33Z","receivedAt":"2017-03-17T15:13:36Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nJunio: this is just a l10n-followup to the previous code patch ;)\n\n po/de.po | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/po/de.po b/po/de.po\nindex e9c86f5488..913db393dc 100644\n--- a/po/de.po\n+++ b/po/de.po\n@@ -7530,7 +7530,19 @@ msgstr \"git describe [<Optionen>] [<Commit-Angabe>...]\"\n msgid \"git describe [<options>] --dirty\"\n msgstr \"git describe [<Optionen>] --dirty\"\n \n-#: builtin/describe.c:217\n+#: builtin/describe.c:52\n+msgid \"head\"\n+msgstr \"Branch\"\n+\n+#: builtin/describe.c:52\n+msgid \"lightweight\"\n+msgstr \"nicht-annotiert\"\n+\n+#: builtin/describe.c:52\n+msgid \"annotated\"\n+msgstr \"annotiert\"\n+\n+#: builtin/describe.c:249\n #, c-format\n msgid \"annotated tag %s not available\"\n msgstr \"annotiertes Tag %s ist nicht verfügbar\"\n-- \n2.12.0.484.g92f9ab2bc1\n\n"},{"id":"314341","messageId":"105f48ad2ae1aa9c88ce6088e6b304294bec0835.1489763302.git.git@drmicha.warpmail.net","threadId":"45409","inReplyTo":null,"subject":"[PATCH 1/2] describe: localize debug output fully","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2017-03-17T15:12:32Z","receivedAt":"2017-03-17T15:14:00Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git describe --debug localizes all debug messages but not the terms\nhead, lightweight, annotated that it outputs for the candidates.\nLocalize them, too.\n\nAlso, increase the width of that field to create room for the translated\nterms.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nRalf: this is just the context for the following l10-de patch\n\n builtin/describe.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 76c18059bf..1a760c16f9 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -49,7 +49,7 @@ struct commit_name {\n };\n \n static const char *prio_names[] = {\n-\t\"head\", \"lightweight\", \"annotated\",\n+\tN_(\"head\"), N_(\"lightweight\"), N_(\"annotated\"),\n };\n \n static int commit_name_cmp(const struct commit_name *cn1,\n@@ -396,8 +396,8 @@ static void describe(const char *arg, int last_one)\n \tif (debug) {\n \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n-\t\t\tfprintf(stderr, \" %-11s %8d %s\\n\",\n-\t\t\t\tprio_names[t->name->prio],\n+\t\t\tfprintf(stderr, \" %-15s %8d %s\\n\",\n+\t\t\t\t_(prio_names[t->name->prio]),\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n \t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n-- \n2.12.0.484.g92f9ab2bc1\n\n"},{"id":"314370","messageId":"xmqqpohf7opl.fsf@gitster.mtv.corp.google.com","threadId":"45409","inReplyTo":"105f48ad2ae1aa9c88ce6088e6b304294bec0835.1489763302.git.git@drmicha.warpmail.net","subject":"Re: [PATCH 1/2] describe: localize debug output fully","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-17T18:17:10Z","receivedAt":"2017-03-17T18:17:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> git describe --debug localizes all debug messages but not the terms\n> head, lightweight, annotated that it outputs for the candidates.\n> Localize them, too.\n>\n> Also, increase the width of that field to create room for the translated\n> terms.\n\nIf you worry about something not fitting within 11, there is no\nguarantee that 15 is enough.  Wouldn't it be saner to make that\n_(\"%-11s %8d %s\\n\") localizable, too?\n\nAlternatively,\n\n\tif (debug) {\n\t\tstatic int label_width = -1;\n\t\tif (label_width < 0) {\n\t\t\tint i;\n\t\t\tfor (i = 0; i < ARRAY_SIZE(prio_names); i++)\n\t\t\t\t... do a one-time width measurement\n                                ... to set label_width\n\t\t}\n\t\tfprintf(stderr, \"%-.*s %8d %s\\n\", \n\t\t                label_width, _(prio_names[t->name->prio]),\n\t\t\t\t...);\n\t...\n\nor something like that, perhaps?\n\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n> Ralf: this is just the context for the following l10-de patch\n>\n>  builtin/describe.c | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/builtin/describe.c b/builtin/describe.c\n> index 76c18059bf..1a760c16f9 100644\n> --- a/builtin/describe.c\n> +++ b/builtin/describe.c\n> @@ -49,7 +49,7 @@ struct commit_name {\n>  };\n>  \n>  static const char *prio_names[] = {\n> -\t\"head\", \"lightweight\", \"annotated\",\n> +\tN_(\"head\"), N_(\"lightweight\"), N_(\"annotated\"),\n>  };\n>  \n>  static int commit_name_cmp(const struct commit_name *cn1,\n> @@ -396,8 +396,8 @@ static void describe(const char *arg, int last_one)\n>  \tif (debug) {\n>  \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n>  \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n> -\t\t\tfprintf(stderr, \" %-11s %8d %s\\n\",\n> -\t\t\t\tprio_names[t->name->prio],\n> +\t\t\tfprintf(stderr, \" %-15s %8d %s\\n\",\n> +\t\t\t\t_(prio_names[t->name->prio]),\n>  \t\t\t\tt->depth, t->name->path);\n>  \t\t}\n>  \t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n"},{"id":"315515","messageId":"baac53f99636b00880c72daf8aec4d66a4755af2.1490633145.git.git@grubix.eu","threadId":"45409","inReplyTo":"xmqqpohf7opl.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2 1/2] describe: localize debug output fully","fromName":"Michael J Gruber","fromEmail":"git@grubix.eu","sentAt":"2017-03-27T16:50:05Z","receivedAt":"2017-03-27T16:50:48Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"git describe --debug localizes all debug messages but not the terms\nhead, lightweight, annotated that it outputs for the candidates.\nLocalize them, too.\n\nSigned-off-by: Michael J Gruber <git@grubix.eu>\n---\n builtin/describe.c | 15 ++++++++++++---\n 1 file changed, 12 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/describe.c b/builtin/describe.c\nindex 45adbf67d5..99e963dfe7 100644\n--- a/builtin/describe.c\n+++ b/builtin/describe.c\n@@ -50,7 +50,7 @@ struct commit_name {\n };\n \n static const char *prio_names[] = {\n-\t\"head\", \"lightweight\", \"annotated\",\n+\tN_(\"head\"), N_(\"lightweight\"), N_(\"annotated\"),\n };\n \n static int commit_name_cmp(const struct commit_name *cn1,\n@@ -395,10 +395,19 @@ static void describe(const char *arg, int last_one)\n \tfree_commit_list(list);\n \n \tif (debug) {\n+\t\tstatic int label_width = -1;\n+\t\tif (label_width < 0) {\n+\t\t\tint i, w;\n+\t\t\tfor (i = 0; i < ARRAY_SIZE(prio_names); i++) {\n+\t\t\t\tw = strlen(_(prio_names[i]));\n+\t\t\t\tif (label_width < w)\n+\t\t\t\t\tlabel_width = w;\n+\t\t\t}\n+\t\t}\t\t\n \t\tfor (cur_match = 0; cur_match < match_cnt; cur_match++) {\n \t\t\tstruct possible_tag *t = &all_matches[cur_match];\n-\t\t\tfprintf(stderr, \" %-11s %8d %s\\n\",\n-\t\t\t\tprio_names[t->name->prio],\n+\t\t\tfprintf(stderr, \" %-*s %8d %s\\n\",\n+\t\t\t\tlabel_width, _(prio_names[t->name->prio]),\n \t\t\t\tt->depth, t->name->path);\n \t\t}\n \t\tfprintf(stderr, _(\"traversed %lu commits\\n\"), seen_commits);\n-- \n2.12.2.584.g7becbf139a\n\n"},{"id":"315516","messageId":"685807568fdafc86707e7c99e82bf03ef8ff3a87.1490633145.git.git@grubix.eu","threadId":"45409","inReplyTo":"xmqqpohf7opl.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2 2/2] l10n: de: translate describe debug terms","fromName":"Michael J Gruber","fromEmail":"git@grubix.eu","sentAt":"2017-03-27T16:50:06Z","receivedAt":"2017-03-27T16:51:11Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Signed-off-by: Michael J Gruber <git@grubix.eu>\n---\n po/de.po | 14 +++++++++++++-\n 1 file changed, 13 insertions(+), 1 deletion(-)\n\ndiff --git a/po/de.po b/po/de.po\nindex e9c86f5488..913db393dc 100644\n--- a/po/de.po\n+++ b/po/de.po\n@@ -7530,7 +7530,19 @@ msgstr \"git describe [<Optionen>] [<Commit-Angabe>...]\"\n msgid \"git describe [<options>] --dirty\"\n msgstr \"git describe [<Optionen>] --dirty\"\n \n-#: builtin/describe.c:217\n+#: builtin/describe.c:52\n+msgid \"head\"\n+msgstr \"Branch\"\n+\n+#: builtin/describe.c:52\n+msgid \"lightweight\"\n+msgstr \"nicht-annotiert\"\n+\n+#: builtin/describe.c:52\n+msgid \"annotated\"\n+msgstr \"annotiert\"\n+\n+#: builtin/describe.c:249\n #, c-format\n msgid \"annotated tag %s not available\"\n msgstr \"annotiertes Tag %s ist nicht verfügbar\"\n-- \n2.12.2.584.g7becbf139a\n\n"},{"id":"315517","messageId":"cover.1490633145.git.git@grubix.eu","threadId":"45409","inReplyTo":"xmqqpohf7opl.fsf@gitster.mtv.corp.google.com","subject":"[PATCH v2 0/2] describe: localize debug output","fromName":"Michael J Gruber","fromEmail":"git@grubix.eu","sentAt":"2017-03-27T16:50:04Z","receivedAt":"2017-03-27T16:51:43Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"v2 computes the width for the localized output dynamically.\nIn fact, it might overcalculated a bit depending on the encoding,\nbut this does not do any harm.\n\nMichael J Gruber (2):\n  describe: localize debug output fully\n  l10n: de: translate describe debug terms\n\n builtin/describe.c | 15 ++++++++++++---\n po/de.po           | 14 +++++++++++++-\n 2 files changed, 25 insertions(+), 4 deletions(-)\n\n-- \n2.12.2.584.g7becbf139a\n\n"},{"id":"315530","messageId":"xmqq4lye1mbp.fsf@gitster.mtv.corp.google.com","threadId":"45409","inReplyTo":"cover.1490633145.git.git@grubix.eu","subject":"Re: [PATCH v2 0/2] describe: localize debug output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-27T20:44:42Z","receivedAt":"2017-03-27T20:45:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@grubix.eu> writes:\n\n> v2 computes the width for the localized output dynamically.\n> In fact, it might overcalculated a bit depending on the encoding,\n> but this does not do any harm.\n\nThanks.\n\nAs you said, if we wanted to actually _align_, then it needs much\nmore work.  But that is not what we are aiming for in this round,\nit should be alright.\n\n"}]}