{"thread":{"id":"56099","subject":"[PATCH] l10n: allows to translate diff messages","startedAt":"2021-07-13T12:01:21Z","lastAt":"2021-07-14T00:23:02Z","messageCount":4,"participants":["Jordi Mas via GitGitGadget","Junio C Hamano","Bagas Sanjaya","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"429889","messageId":"pull.1045.git.git.1626177676801.gitgitgadget@gmail.com","threadId":"56099","inReplyTo":null,"subject":"[PATCH] l10n: allows to translate diff messages","fromName":"Jordi Mas via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-07-13T12:01:16Z","receivedAt":"2021-07-13T12:01:21Z","isPatch":true,"sender":{"key":"jmas@softcatala.org","avatar":"https://avatars.githubusercontent.com/u/309265?v=4"},"body":"From: Jordi Mas <jmas@softcatala.org>\n\nAllows to translate the diff messages shown when the\nuser commits, indicating the number of insertions,\ndeletions and files changed.\n\nSigned-off-by: Jordi Mas <jmas@softcatala.org>\n---\n    Allow to translate diff message\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1045%2Fjordimas%2Flocalize-msg-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1045/jordimas/localize-msg-v1\nPull-Request: https://github.com/git/git/pull/1045\n\n diff.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 52c791574b..29db9ce079 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2593,7 +2593,7 @@ static void print_stat_summary_inserts_deletes(struct diff_options *options,\n \t}\n \n \tstrbuf_addf(&sb,\n-\t\t    (files == 1) ? \" %d file changed\" : \" %d files changed\",\n+\t\t    Q_(\" %d file changed\", \" %d files changed\", files),\n \t\t    files);\n \n \t/*\n@@ -2606,13 +2606,13 @@ static void print_stat_summary_inserts_deletes(struct diff_options *options,\n \t */\n \tif (insertions || deletions == 0) {\n \t\tstrbuf_addf(&sb,\n-\t\t\t    (insertions == 1) ? \", %d insertion(+)\" : \", %d insertions(+)\",\n+\t\t\t    Q_(\", %d insertion(+)\", \", %d insertions(+)\", insertions),\n \t\t\t    insertions);\n \t}\n \n \tif (deletions || insertions == 0) {\n \t\tstrbuf_addf(&sb,\n-\t\t\t    (deletions == 1) ? \", %d deletion(-)\" : \", %d deletions(-)\",\n+\t\t\t    Q_(\", %d deletion(-)\", \", %d deletions(-)\", deletions),\n \t\t\t    deletions);\n \t}\n \tstrbuf_addch(&sb, '\\n');\n\nbase-commit: d486ca60a51c9cb1fe068803c3f540724e95e83a\n-- \ngitgitgadget\n"},{"id":"429949","messageId":"xmqq4kcx24j7.fsf@gitster.g","threadId":"56099","inReplyTo":"pull.1045.git.git.1626177676801.gitgitgadget@gmail.com","subject":"Re: [PATCH] l10n: allows to translate diff messages","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-07-13T23:11:08Z","receivedAt":"2021-07-13T23:11:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jordi Mas via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Subject: Re: [PATCH] l10n: allows to translate diff messages\n\n\"allow to translate\" would be the right phrasing, but it is too\nvague to say \"diff messages\".  You are only marking 3 messages for\ntranslation when there are probably a handful more.  \n\nYou need to explain which ones, not just vague \"diff messages\".\n\nI think you are focusing on the words on the \"git diff --stat\" and\n\"git diff --shortstat\" summary line, so\n\n    i18n: mark \"git diff --[short]stat\" summary for translation\n\nperhaps?  And remember, i18n is the act of making the code capable\nof being translated, while l10n is the act of actually translating\nwhat i18n prepared into a particular language.  Here, i18n is more\nappropriate.\n\n> From: Jordi Mas <jmas@softcatala.org>\n>\n> Allows to translate the diff messages shown when the\n> user commits, indicating the number of insertions,\n> deletions and files changed.\n\nOur log message first explain the current status/behaviour of the\ncode (and highlight the problem in it), and then gives an order to\nthe codebase to \"be like so\" in imperative mood.  Perhaps like this:\n\n    \"git diff --[short]stat\" summarizes the number of paths touched\n    and lines inserted and deleted.  Mark this message for\n    translation.\n\nNote that I didn't explicitly say what's wrong with the current\nbehaviour, but \"mark for translation\" as the order given to the\ncodebase, it should be clear enough from the context that the\nproblem is that it is not marked for translation.\n\nHaving said all that, I am not sure if this patch stop at a sensible\npoint.  At least \"git diff --summary\" output should also be updated\nto match, as they often go hand-in-hand, no?\n\nAlso, when showing \"git diff --stat\" for a binary file, we'd say\n\n\t$path | Bin 1234 -> 1236 bytes\n\nI wonder if that should also be translated.\n\nWhile I am at it, there are a handful things that should NEVER be\ntranslated in the \"git diff\" output.\n\n> diff --git a/diff.c b/diff.c\n> index 52c791574b..29db9ce079 100644\n\nBetween \"diff --git\" and \"--- a/$path\", there are metainfo lines\nthat are read by \"git apply\" (including this \"index\" line).  They\nshould never be translated.\n\nThanks.\n"},{"id":"429956","messageId":"934273c6-b112-892b-f746-4647b5db3317@gmail.com","threadId":"56099","inReplyTo":"xmqq4kcx24j7.fsf@gitster.g","subject":"Re: [PATCH] l10n: allows to translate diff messages","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-07-14T00:09:43Z","receivedAt":"2021-07-14T00:09:48Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"On 14/07/21 06.11, Junio C Hamano wrote:\n> Also, when showing \"git diff --stat\" for a binary file, we'd say\n> \n> \t$path | Bin 1234 -> 1236 bytes\n> \n> I wonder if that should also be translated.\n> \n\nI think that above should also be translated, for consistency with diff \nfor regular text file.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"429969","messageId":"87zgup217d.fsf@evledraar.gmail.com","threadId":"56099","inReplyTo":"xmqq4kcx24j7.fsf@gitster.g","subject":"Re: [PATCH] l10n: allows to translate diff messages","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-07-14T00:18:42Z","receivedAt":"2021-07-14T00:23:02Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Jul 13 2021, Junio C Hamano wrote:\n\n> \"Jordi Mas via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> Subject: Re: [PATCH] l10n: allows to translate diff messages\n>\n> \"allow to translate\" would be the right phrasing, but it is too\n> vague to say \"diff messages\".  You are only marking 3 messages for\n> translation when there are probably a handful more.  \n>\n> You need to explain which ones, not just vague \"diff messages\".\n>\n> I think you are focusing on the words on the \"git diff --stat\" and\n> \"git diff --shortstat\" summary line, so\n>\n>     i18n: mark \"git diff --[short]stat\" summary for translation\n>\n> perhaps?  And remember, i18n is the act of making the code capable\n> of being translated, while l10n is the act of actually translating\n> what i18n prepared into a particular language.  Here, i18n is more\n> appropriate.\n\nWhat i18n v.s. l10n means is quite the side-discussion, I have not heard\nit used like this before, but rather as e.g. defined at :\nhttps://www.w3.org/International/questions/qa-i18n\n\nI.e. in git.git's case that all our gettext-ization would fall under\ni18n, but l10n are generally a step beyond that, e.g. if \"git status\"\noutput entries were sorted by locale, fsck and other progress.c users\nused localized numeric formatting etc.\n\nIOW I agree that i18n is more appropriate here, I just hadn't heard\ni18n/l10n used in the way that you describe.\n"}]}