git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Add hint for translators for y/n reply.

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2015, 04:02 UTC
Message-ID
<xmqqa8zxgybr.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CANYiYbGuRjNZARc278py=MzDDXukAfLJv3kWdnBa6_ia7WDvRg@mail.gmail.com>
Jiang Xin <worldhello.net@gmail.com> writes:
Show 17 quoted lines
> 2015-02-28 23:39 GMT+08:00 Jean-Noel Avila <jn.avila@free.fr>:
>> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
>> ---
>>  builtin/clean.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/builtin/clean.c b/builtin/clean.c
>> index 7e7fdcf..2c98661 100644
>> --- a/builtin/clean.c
>> +++ b/builtin/clean.c
>> @@ -754,6 +754,9 @@ static int ask_each_cmd(void)
>>                 /* Ctrl-D should stop removing files */
>>                 if (!eof) {
>>                         qname = quote_path_relative(item->string, NULL, &buf);
>> +                       /*TRANSLATORS: Make sure to include [Y] and [n] in your
>> +                       translation. The program will only accept English input
>> +                       at this point. */

A comment "We will accept only y, Y, Ye, YE,... as 'affirmative'" in the code to translators will not help the end users at all, so make it a single liner like this:

	/* TRANSLATORS: make sure to keep [y/N] as-is */
Make sure you have SP after slash-asterisk.
Show 6 quoted lines
>>                         printf(_("remove %s? "), qname);
>
> Yes, it may confuse.  In order to let the translators notice this and update,
> you'd better change the code like this:
>
>         printf(_("remove %s [y/N]? "), qname);

A very good suggestion. The code that follows this part treats an empty input and a random non-empty input that does not head-match "yes" as "please do not remove"; upcasing N is a good visual hint that that "no" is the default.

Thanks.
Previous: Jiang XinNext: Jean-Noel Avila
Message 7 of 9 in “Internationalization and yes/no prompts”
  1. Pierre-Olivier VaresFeb 23, 2015
  2. Junio C HamanoFeb 24, 2015
  3. Jean-Noël AvilaFeb 25, 2015
  4. Add hint for translators for y/n reply.Jean-Noel Avila, Feb 28, 2015
  5. Jiang XinMar 1, 2015
  6. Jiang XinMar 1, 2015
  7. Junio C HamanoMar 1, 2015
  8. [PATCHv2] Add hint interactive cleaningJean-Noel Avila, Mar 1, 2015
  9. Junio C HamanoMar 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.