Re: [PATCH 10/22] sequencer: avoid completely different messages for different actions
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Sep 1, 2016, 22:33 UTC
- Message-ID
- <198780d4-dbef-c0cc-fb4c-fc8986a33002@gmail.com>
- In-Reply-To
- <alpine.DEB.2.20.1609010950150.129229@virtualbox>
Hello Johannes
W dniu 01.09.2016 o 09:52, Johannes Schindelin pisze:
> On Wed, 31 Aug 2016, Jakub Narębski wrote: >> CC-ed to Jiang Xin, L10N coordinator. >> W dniu 29.08.2016 o 10:05, Johannes Schindelin pisze:
[...]
Show 20 quoted lines
>>> - /* Different translation strings for cherry-pick and revert */
>>> - if (opts->action == REPLAY_PICK)
>>> - error(_("Your local changes would be overwritten by cherry-pick."));
>>> - else
>>> - error(_("Your local changes would be overwritten by revert."));
>>> + error(_("Your local changes would be overwritten by %s."),
>>> + action_name(opts));
>>
>> If I understand it correctly, it would make "revert" or "cherry-pick"
>> untranslated part of error message. You would need to use translation
>> on the result with "_(action_name(opts))", you would have to mark
>> todo_command_strings elements for gettext lexicon with N_(...).
>>
>> I am rather against this change (see also below).
>
> Okay.
>
> Unfortunately, I have to focus on the correctness of the code at the
> moment (and Git for Windows does ship *without* translations for the time
> being anyway, mostly to save on space, but also because users complained).Users complained about having translations, or not having easy way to switch them or switch them off?
Show 6 quoted lines
> > So I will take care of this after v2.10.0. > > For the record, how is this supposed to be handled, in particular when I > introduce a new action whose action_name(opts) will be "rebase -i"? Do I > really need to repeat myself three times?
I think you should be able to mark strings to be translated, without translating them at the time of definition,
static const char *todo_command_strings[] = {
N_("pick"),
N_("revert")
};then translate at the point of use
error(_("Your local changes would be overwritten by %s."),
_(action_name(opts)));I assume that action_name(opts) returns one of todo_command_strings. If not, there should be array with possible actions.
Assuming that such lego l10n is preferable to multiple translations, more free-formt.
-- Jakub Narębski