Re: [RFC/PATCH] sequencer: do not translate reflog messages
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 16, 2022, 11:02 UTC
- Message-ID
- <09rn6r61-38qo-4s1q-q7qq-p5onp6p87o44@tzk.qr>
- In-Reply-To
- <870072d5-d220-09e7-684b-f9d7d8d59c93@gmail.com>
Hi Phillip,
On Tue, 16 Aug 2022, Phillip Wood wrote:
Show 28 quoted lines
> On 15/08/2022 21:20, Johannes Schindelin wrote:
>
> > On Fri, 12 Aug 2022, Junio C Hamano wrote:
> >
> > > Phillip Wood <phillip.wood123@gmail.com> writes:
> > >
> > > > Removing the N_() stops these strings from being extracted for
> > > > translation, but there are several callers left that are still using
> > > > _() to get the (now non-existent) translated string. I only had a
> > > > quick look but I think we should remove the _() from all the callers
> > > > of action_name().
> > >
> > > Thanks, that's all correct.
> >
> > I am afraid that it is not.
> >
> > In https://github.com/git/git/blob/v2.37.2/sequencer.c#L502-L503, for
> > example, we use the value returned by `action_name()` in a translated
> > message:
> >
> > error(_("your local changes would be overwritten by %s."),
> > _(action_name(opts)));
>
> Isn't this message using action_name() to get the name of the command that the
> user ran? As that name is not localized when the user runs the command I don't
> see that we should be translating it (and playing sentence lego with the
> result) in this message. I think the same applies to the message at line 689
> that you mention below.I do not believe that this error message talks about the command, otherwise it would use "`git %s`" instead of "%s" here. Imagine, for a second, that Git was written in French and you preferred to read your error messages in English, therefore set your locale, and you just issued a `git retour`, would this error message read well for you?
error: your local changes would be overwritten by retour.
That looks wrong to me. I could see us changing this to:
error: your local changes would be overwritten by `git retour`.
or to:
error: your local changes would be overwritten by revert.
i.e. either use "`git %s`" without translating, or keeping "%s" with the translated `action_name()`. But it would probably read better to have the action name localized (which is what I suggested).
Ciao, Dscho