Re: [PATCH v2 2/2] doc: diff-options.adoc: show format.noprefix for format-patch
- From
Jean-Noël AVILA <jn.avila@free.fr>
- Date
- Feb 28, 2026, 14:08 UTC
- Message-ID
- <5970320.DvuYhMxLoT@piment-oiseau>
- In-Reply-To
- <better_for_translators.424@msgid.xyz>
On Saturday, 28 February 2026 13:20:33 CET kristofferhaugsbakk@fastmail.com wrote:
Show 55 quoted lines
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>
> On Fri, Feb 27, 2026, at 10:57, Jean-Noël Avila wrote:
> > Le 24/02/2026 à 00:30, kristofferhaugsbakk@fastmail.com a écrit :
> >> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
> >>
> >>[snip]
> >>
> >> `--default-prefix`::
> >> Use the default source and destination prefixes ("a/" and "b/").
> >>
> >> - This overrides configuration variables such as `diff.noprefix`,
> >> + This overrides configuration variables such as
> >> +ifndef::git-format-patch[`diff.noprefix`,]
> >> +ifdef::git-format-patch[`format.noprefix`,]
> >>
> >> `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`
> >> (see linkgit:git-config[1]).
> >
> > Hello,
> >
> > This kind of sentence assembly does not fit well with translations. Each
> > hunk of the sentence is processed separately and it is a difficulty for
> > translators as they need to understand the surrounding context of a
> > segment when translating it.
> >
> > It is safer to just write the whole paragraph, or at least a sentence in
> > the ifdef/ifndef sections.
>
> Thanks for bringing this up. I have never taken doc translations into
> consideration.
>
> Would the following be the correct approach?
>
> -- 8< --
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
> Subject: [PATCH] doc: diff-options.adoc: make *.noprefix split translatable
>
> We cannot split single words like what we did in the previous
> commit. That is because the doc translations are processed in
> bigger chunks.
>
> Instead write the two paragraphs with the only variations being this
> configuration variable.
>
> It’s not easy to spot the difference here. So let’s leave a comment
> for translators.
>
> Reported-by: Jean-Noël Avila <jn.avila@free.fr>
> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
> ---
> Documentation/diff-options.adoc | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/diff-options.adoc b/Documentation/diff-options.adoc
Show 23 quoted lines
> index 8f632d5fe1a..e4d02cc93a9 100644
> --- a/Documentation/diff-options.adoc
> +++ b/Documentation/diff-options.adoc
> @@ -859,12 +859,19 @@ endif::git-format-patch[]
> Do not show any source or destination prefix.
>
> `--default-prefix`::
> +// TRANSLATORS: format.noprefix / diff.noprefix
> +ifdef::git-format-patch[]
> Use the default source and destination prefixes ("a/" and "b/").
> - This overrides configuration variables such as
> -ifndef::git-format-patch[`diff.noprefix`,]
> -ifdef::git-format-patch[`format.noprefix`,]
> + This overrides configuration variables such as `format.noprefix`,
> `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`
> (see linkgit:git-config[1]).
> +endif::git-format-patch[]
> +ifndef::git-format-patch[]
> + Use the default source and destination prefixes ("a/" and "b/").
> + This overrides configuration variables such as `diff.noprefix`,
> + `diff.srcPrefix`, `diff.dstPrefix`, and `diff.mnemonicPrefix`
> + (see linkgit:git-config[1]).
> +ifndef::git-format-patch[]I think this line should read : endif::git-format-patch[] I also don't quite understand the addition of the // TRANSLATORS: part. This is not needed as each paragraph will be translated as a standalone segment.
Otherwise, this format of conditional text is fit for translation.
Thanks