Re: [PATCH 19/21] t9003: become resilient to GETTEXT_POISON
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 20, 2016, 17:59 UTC
- Message-ID
- <xmqqh9dsehl6.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <xmqqoa80ei03.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> Vasco Almeida <vascomalmeida@sapo.pt> writes: > >> Alternatively, we could leave sed alone as it were before this patch and >> use test_i18ngrep instead of grep to fake success under GETTEXT_POISON. >> I think I prefer this way. What do you think? > > That is equivalent to saying that "we would translate 'lgf' to > end-user's language", which does not make much sense to me. > > Wouldn't the introductory explanation, up to "Did you mean this?", > be the only thing that is translated?
I just checked the code ;-) We do this:
fprintf_ln(stderr,
Q_("\nDid you mean this?",
"\nDid you mean one of these?",
n));for (i = 0; i < n; i++) fprintf(stderr, "\t%s\n", main_cmds.names[i]->name);
Using test_i18ngrep would mean we would not be able to catch a potential future bug that does an equivalent of
for (i = 0; i < n; i++) fprintf(stderr, "\t%s\n", _(main_cmds.names[i]->name));
in the loop, i.e. marking something that is not meant to be translated as translatable.
As long as translators do not translate "Did you mean..." to begin a line with a tab (which I do not think there is any reason to), it is going to work reliably to grep for "^ lgf$" here, and it will catch such a potential future bug under GETTEXT_POISON build.