public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* format-patch: why are the Range-diff: and Interdiff: headers translated?
@ 2025-09-23 16:53 Kristoffer Haugsbakk
  2025-09-23 18:16 ` Eric Sunshine
  0 siblings, 1 reply; 6+ messages in thread
From: Kristoffer Haugsbakk @ 2025-09-23 16:53 UTC (permalink / raw)
  To: git; +Cc: Eric Sunshine

git-format-patch(1) has had translated strings for `Range-diff:` and
`Interdiff:` since they were introduced.[1][2][3]

    // Example
    _("Interdiff against v%d: ...

Is that how translated/l10n Git is supposed to to work?  I get
translating errors and such—that’s for the user.  But a Colombian user
might send out patches to an international email list.  Why should their
own translated UI (again, if I’m understanding l10n correctly) affect
the patch output?

I found no comments on these changes.

🔗 1: https://lore.kernel.org/git/20180722095717.17912-1-sunshine@sunshineco.com/#t
† 2: 688cb1c9 (Merge branch 'es/format-patch-interdiff', 2018-09-17)
† 3: 881c019e (Merge branch 'es/format-patch-rangediff', 2018-09-17)

-- 
Kristoffer

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: format-patch: why are the Range-diff: and Interdiff: headers translated?
  2025-09-23 16:53 format-patch: why are the Range-diff: and Interdiff: headers translated? Kristoffer Haugsbakk
@ 2025-09-23 18:16 ` Eric Sunshine
  2025-09-23 19:59   ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2025-09-23 18:16 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: git

On Tue, Sep 23, 2025 at 12:54 PM Kristoffer Haugsbakk
<kristofferhaugsbakk@fastmail•com> wrote:
> git-format-patch(1) has had translated strings for `Range-diff:` and
> `Interdiff:` since they were introduced.[1][2][3]
>
>     // Example
>     _("Interdiff against v%d: ...
>
> Is that how translated/l10n Git is supposed to to work?  I get
> translating errors and such—that’s for the user.  But a Colombian user
> might send out patches to an international email list.  Why should their
> own translated UI (again, if I’m understanding l10n correctly) affect
> the patch output?

Making these translatable was deliberate. As I recall, I had been able
to formulate arguments in favor of both making them translatable and
making them non-translatable, though I no longer remember what those
arguments were. One argument in favor may have been that (a) the
titles "Interdiff" & "Range-diff" are meant for human readers, not for
machine consumption, and (b) there may very well be
non-English-centric projects (open-source or not) using a patch-based
workflow.

I further recall that I was expecting pushback from reviewers and was
surprised when there was none. Hence, those titles remained
translatable in the final version.

As far as I recall, this is only the second time in the intervening
years that someone has questioned why the titles are translatable. If
your reason for posing this question is that you believe the titles
should not be translatable and you wish to submit a patch series to
rectify that, then you won't get pushback from me. Also, in support of
such a proposal, I do recall (though can't find the email) that Junio
once pushed back years ago against someone proposing to make the
diffstat "x file changed, y insertions(+), z deletions(-)" summary
translatable.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: format-patch: why are the Range-diff: and Interdiff: headers translated?
  2025-09-23 18:16 ` Eric Sunshine
@ 2025-09-23 19:59   ` Kristoffer Haugsbakk
  2025-09-24  0:41     ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Kristoffer Haugsbakk @ 2025-09-23 19:59 UTC (permalink / raw)
  To: Eric Sunshine; +Cc: git

On Tue, Sep 23, 2025, at 20:16, Eric Sunshine wrote:
> On Tue, Sep 23, 2025 at 12:54 PM Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail•com> wrote:
>> git-format-patch(1) has had translated strings for `Range-diff:` and
>> `Interdiff:` since they were introduced.[1][2][3]
>>
>>     // Example
>>     _("Interdiff against v%d: ...
>>
>> Is that how translated/l10n Git is supposed to to work?  I get
>> translating errors and such—that’s for the user.  But a Colombian user
>> might send out patches to an international email list.  Why should their
>> own translated UI (again, if I’m understanding l10n correctly) affect
>> the patch output?
>
> Making these translatable was deliberate. As I recall, I had been able
> to formulate arguments in favor of both making them translatable and
> making them non-translatable, though I no longer remember what those
> arguments were.

Thanks for quick and solid reply!

> One argument in favor may have been that (a) the titles "Interdiff" &
> "Range-diff" are meant for human readers, not for machine consumption,
> and (b) there may very well be non-English-centric projects
> (open-source or not) using a patch-based workflow.

I’m not concerned about machine-readability.  My thought was that
localization/l10n of this software was intended for the user themselves.
And also that users might, without intending to do so necessarily, end
up using localized output in contexts where they do want English
strings, like on an English-language mailing list.  Even though they
might prefer Spanish (from my Colombian example) when using Git
themselves.

But there might for all I know be Colombian/Latin American patch mailing
lists where localization like this works great.

I’m not really in the natural target group for l10n Git.  I might be
totally missing all the use-cases here.

> I further recall that I was expecting pushback from reviewers and was
> surprised when there was none. Hence, those titles remained
> translatable in the final version.
>
> As far as I recall, this is only the second time in the intervening
> years that someone has questioned why the titles are translatable. If
> your reason for posing this question is that you believe the titles
> should not be translatable and you wish to submit a patch series to
> rectify that, then you won't get pushback from me. Also, in support of
> such a proposal, I do recall (though can't find the email) that Junio
> once pushed back years ago against someone proposing to make the
> diffstat "x file changed, y insertions(+), z deletions(-)" summary
> translatable.

Oh, not at all.  I don’t intend to send any patches to change something
that only me (and one other person from years ago?) have questions
about.  These are only questions, after all (from my side anyway).

Good night!

-- 
Kristoffer Haugsbakk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: format-patch: why are the Range-diff: and Interdiff: headers translated?
  2025-09-23 19:59   ` Kristoffer Haugsbakk
@ 2025-09-24  0:41     ` Jeff King
  2025-09-24  2:08       ` Ben Knoble
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff King @ 2025-09-24  0:41 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: Eric Sunshine, git

On Tue, Sep 23, 2025 at 09:59:55PM +0200, Kristoffer Haugsbakk wrote:

> I’m not concerned about machine-readability.  My thought was that
> localization/l10n of this software was intended for the user themselves.
> And also that users might, without intending to do so necessarily, end
> up using localized output in contexts where they do want English
> strings, like on an English-language mailing list.  Even though they
> might prefer Spanish (from my Colombian example) when using Git
> themselves.
> 
> But there might for all I know be Colombian/Latin American patch mailing
> lists where localization like this works great.
> 
> I’m not really in the natural target group for l10n Git.  I might be
> totally missing all the use-cases here.

I'm not a user of the l10n stuff either, so you can take my opinion with
a grain of salt. But it seems obvious to me that "the language I am most
comfortable using" and "the language for the project I am contributing
to" might not necessarily be the same.

I'm not sure how well gettext supports this use case, though. The first
one should obviously come from LANG, etc. If we added a hypothetical
format.lang config option, is there a way to tell gettext to translate a
string using a language string provided per-call, rather than from the
environment?

I don't know that anybody is really even asking for this, so I'm not
proposing to spend a lot of effort on it. But the thread made me wonder
what is even possible/easy to do here.

-Peff

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: format-patch: why are the Range-diff: and Interdiff: headers translated?
  2025-09-24  0:41     ` Jeff King
@ 2025-09-24  2:08       ` Ben Knoble
  2025-09-24  5:11         ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: Ben Knoble @ 2025-09-24  2:08 UTC (permalink / raw)
  To: Jeff King; +Cc: Kristoffer Haugsbakk, Eric Sunshine, git


> Le 23 sept. 2025 à 20:42, Jeff King <peff@peff•net> a écrit :
> 
> On Tue, Sep 23, 2025 at 09:59:55PM +0200, Kristoffer Haugsbakk wrote:
> 
>> I’m not concerned about machine-readability.  My thought was that
>> localization/l10n of this software was intended for the user themselves.
>> And also that users might, without intending to do so necessarily, end
>> up using localized output in contexts where they do want English
>> strings, like on an English-language mailing list.  Even though they
>> might prefer Spanish (from my Colombian example) when using Git
>> themselves.
>> 
>> But there might for all I know be Colombian/Latin American patch mailing
>> lists where localization like this works great.
>> 
>> I’m not really in the natural target group for l10n Git.  I might be
>> totally missing all the use-cases here.
> 
> I'm not a user of the l10n stuff either, so you can take my opinion with
> a grain of salt. But it seems obvious to me that "the language I am most
> comfortable using" and "the language for the project I am contributing
> to" might not necessarily be the same.

Yep. My own patches have probably come in with French titles here because I set LANG that way.

> I'm not sure how well gettext supports this use case, though. The first
> one should obviously come from LANG, etc. If we added a hypothetical
> format.lang config option, is there a way to tell gettext to translate a
> string using a language string provided per-call, rather than from the
> environment?
> 
> I don't know that anybody is really even asking for this, so I'm not
> proposing to spend a lot of effort on it. But the thread made me wonder
> what is even possible/easy to do here.

I’m not asking at the moment, since it hasn’t bothered anyone. If it does and there’s a need to do something else, I’ll fix my workflow (opting in to such new config or otherwise, as the case may be).  

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: format-patch: why are the Range-diff: and Interdiff: headers translated?
  2025-09-24  2:08       ` Ben Knoble
@ 2025-09-24  5:11         ` Jeff King
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff King @ 2025-09-24  5:11 UTC (permalink / raw)
  To: Ben Knoble; +Cc: Kristoffer Haugsbakk, Eric Sunshine, git

On Tue, Sep 23, 2025 at 10:08:42PM -0400, Ben Knoble wrote:

> Yep. My own patches have probably come in with French titles here
> because I set LANG that way.

TBH, I hadn't even noticed. I think after a while I end up just looking
past stuff like:

> > Le 23 sept. 2025 à 20:42, Jeff King <peff@peff•net> a écrit :

without even reading it. I did a quick search in the archives, and yeah,
one of your v2's has "Diff-intervalle contre v1". It's pretty clear what
it means in context even if you don't understand any French, and I think
it adds some flavor to the list. ;)

-Peff

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-24  5:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 16:53 format-patch: why are the Range-diff: and Interdiff: headers translated? Kristoffer Haugsbakk
2025-09-23 18:16 ` Eric Sunshine
2025-09-23 19:59   ` Kristoffer Haugsbakk
2025-09-24  0:41     ` Jeff King
2025-09-24  2:08       ` Ben Knoble
2025-09-24  5:11         ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox