git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] l10n: allows to translate diff messages

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 13, 2021, 23:11 UTC
Message-ID
<xmqq4kcx24j7.fsf@gitster.g>
In-Reply-To
<pull.1045.git.git.1626177676801.gitgitgadget@gmail.com>
"Jordi Mas via GitGitGadget" <gitgitgadget@gmail.com> writes:
> Subject: Re: [PATCH] l10n: allows to translate diff messages

"allow to translate" would be the right phrasing, but it is too vague to say "diff messages". You are only marking 3 messages for translation when there are probably a handful more.

You need to explain which ones, not just vague "diff messages".

I think you are focusing on the words on the "git diff --stat" and "git diff --shortstat" summary line, so

    i18n: mark "git diff --[short]stat" summary for translation

perhaps? And remember, i18n is the act of making the code capable of being translated, while l10n is the act of actually translating what i18n prepared into a particular language. Here, i18n is more appropriate.

Show 5 quoted lines
> From: Jordi Mas <jmas@softcatala.org>
>
> Allows to translate the diff messages shown when the
> user commits, indicating the number of insertions,
> deletions and files changed.

Our log message first explain the current status/behaviour of the code (and highlight the problem in it), and then gives an order to the codebase to "be like so" in imperative mood. Perhaps like this:

    "git diff --[short]stat" summarizes the number of paths touched
    and lines inserted and deleted.  Mark this message for
    translation.

Note that I didn't explicitly say what's wrong with the current behaviour, but "mark for translation" as the order given to the codebase, it should be clear enough from the context that the problem is that it is not marked for translation.

Having said all that, I am not sure if this patch stop at a sensible point. At least "git diff --summary" output should also be updated to match, as they often go hand-in-hand, no?

Also, when showing "git diff --stat" for a binary file, we'd say
	$path | Bin 1234 -> 1236 bytes
I wonder if that should also be translated.

While I am at it, there are a handful things that should NEVER be translated in the "git diff" output.

> diff --git a/diff.c b/diff.c
> index 52c791574b..29db9ce079 100644

Between "diff --git" and "--- a/$path", there are metainfo lines that are read by "git apply" (including this "index" line). They should never be translated.

Thanks.
Previous: Jordi Mas via GitGitGadgetNext: Bagas Sanjaya
Message 2 of 4 in “l10n: allows to translate diff messages”
  1. l10n: allows to translate diff messagesJordi Mas via GitGitGadget, Jul 13, 2021
  2. Junio C HamanoJul 13, 2021
  3. Bagas SanjayaJul 14, 2021
  4. Ævar Arnfjörð BjarmasonJul 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.