{"thread":{"id":"38634","subject":"Internationalization and yes/no prompts","startedAt":"2015-02-23T15:46:07Z","lastAt":"2015-03-02T19:39:39Z","messageCount":9,"participants":["Pierre-Olivier Vares","Junio C Hamano","Jean-Noël Avila","Jean-Noel Avila","Jiang Xin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256514","messageId":"54EB4B3F.6080706@fingerprint.fr","threadId":"38634","inReplyTo":"20150212085211.9112780692@smtp-out.fingerprint.fr","subject":"Internationalization and yes/no prompts","fromName":"Pierre-Olivier Vares","fromEmail":"pierre-olivier.vares@fingerprint.fr","sentAt":"2015-02-23T15:46:07Z","receivedAt":"2015-02-23T15:46:07Z","isPatch":false,"sender":{"key":"pierre-olivier.vares@fingerprint.fr","avatar":null},"body":"Hi,\n\nI just fell in a little trap, in which you may find interest.\n\nI'm using git on the command line (on an Elementary OS system : Linux \n3.2.0-76-generic #111-Ubuntu SMP Tue Jan 13 22:16:09 UTC 2015 x86_64 \nx86_64 x86_64 GNU/Linux).\ngit version : 2.3.0\n\nMy system is configured in french.\n\nThat's said :\nI run a git clean -i, and select option 4 (ask each).\n     (By the fact, messages are translated, but options of the \n'interactive' menu aren't)\nSo I get, for each file, the question :\n/Supprimer //premier_fichier ? [Remove first_file ?]/\nNatural answer to this question is 'Oui' [Yes], so I type 'o', rather \nthan 'y'.\nOnce finished, I see no file has been removed (since 'o' has been \nconsidered as 'different than yes')\nWhereas it's not an end-of-the-world thing*, it's annoying as at first \nsight I didn't understand why it has 'not worked'.\n\nI thought of a few possibilities (some easy to implement, others more \ncomplex; some are stricter for the user) :\n- explicitly put \"y/n\" in the message. Translaters should be warned to \nlet \"y/n\",\n- only allow y and n answers (and variants : yes, no), and reject \neverything else with a message\n- use as 'n', but echoes a message : 'Answer considered as /no/'\n- accept answers depending on the language used to echo the prompt (y/n \nfor english, o/n for french, j/n for german, ...)\n\nWhat do you think about that ?\n\n* but just imagine how worst it could be if you're configured in a \nlanguage where 'No' is said using a word beginning by 'Y'...\n\nCheers,\nPierre-Olivier Vares\n"},{"id":"256590","messageId":"xmqq1tlfqcd8.fsf@gitster.dls.corp.google.com","threadId":"38634","inReplyTo":"54EB4B3F.6080706@fingerprint.fr","subject":"Re: Internationalization and yes/no prompts","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-02-24T20:32:35Z","receivedAt":"2015-02-24T20:32:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pierre-Olivier Vares <pierre-olivier.vares@fingerprint.fr> writes:\n\n> /Supprimer //premier_fichier ? [Remove first_file ?]/\n> Natural answer to this question is 'Oui' [Yes], so I type 'o', rather\n> than 'y'.\n> Once finished, I see no file has been removed (since 'o' has been\n> considered as 'different than yes')\n> Whereas it's not an end-of-the-world thing*, it's annoying as at first\n> sight I didn't understand why it has 'not worked'.\n>\n> I thought of a few possibilities (some easy to implement, others more\n> complex; some are stricter for the user) :\n\n> - explicitly put \"y/n\" in the message. Translaters should be warned to\n> let \"y/n\",\n\nThis may be suboptimal from the end-user's point of view, but it is\nthe least risky of breaking anything.\n\nAnd it is way better than the status quo.\n\n> - only allow y and n answers (and variants : yes, no), and reject\n> everything else with a message\n\nThis is not helpful to the users if it does not say why (O)ui was\nrejected, which would mean we would be better off saying [Y/n] in\nthe message in the first place.\n\n> - use as 'n', but echoes a message : 'Answer considered as /no/'\n\nUnhelpful without stating why (O)ui was considered as 'no'; same\nconclusion as above.\n\n> - accept answers depending on the language used to echo the prompt\n> (y/n for english, o/n for french, j/n for german, ...)\n\nThis would be the best for languages where translations for Yes and\nNo begin with different letters, but I suspect it might be tricky to\nimplement.\n"},{"id":"256621","messageId":"54ED98F7.1040207@gmail.com","threadId":"38634","inReplyTo":"xmqq1tlfqcd8.fsf@gitster.dls.corp.google.com","subject":"Re: Internationalization and yes/no prompts","fromName":"Jean-Noël Avila","fromEmail":"avila.jn@gmail.com","sentAt":"2015-02-25T09:42:15Z","receivedAt":"2015-02-25T09:42:15Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Le 24/02/2015 21:32, Junio C Hamano a écrit :\n>> - explicitly put \"y/n\" in the message. Translaters should be warned to\n>> let \"y/n\",\n> This may be suboptimal from the end-user's point of view, but it is\n> the least risky of breaking anything.\n>\n> And it is way better than the status quo.\n>\n>\n\nI can push a small update for this one.\n\nThe \"yes\" string could be translated in builtin/clean.c\n\nAre there other places where a translated part asks explicitly for a\nyes/no reply? It is not clear from the content of the po file.\n\nBR\n\nJean-Noël\n"},{"id":"256779","messageId":"1425137944-13667-1-git-send-email-jn.avila@free.fr","threadId":"38634","inReplyTo":"xmqq1tlfqcd8.fsf@gitster.dls.corp.google.com","subject":"[PATCH] Add hint for translators for y/n reply.","fromName":"Jean-Noel Avila","fromEmail":"jn.avila@free.fr","sentAt":"2015-02-28T15:39:04Z","receivedAt":"2015-02-28T15:39:04Z","isPatch":true,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n---\n builtin/clean.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 7e7fdcf..2c98661 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -754,6 +754,9 @@ static int ask_each_cmd(void)\n \t\t/* Ctrl-D should stop removing files */\n \t\tif (!eof) {\n \t\t\tqname = quote_path_relative(item->string, NULL, &buf);\n+\t\t\t/*TRANSLATORS: Make sure to include [Y] and [n] in your\n+\t\t\ttranslation. The program will only accept English input\n+\t\t\tat this point. */\n \t\t\tprintf(_(\"remove %s? \"), qname);\n \t\t\tif (strbuf_getline(&confirm, stdin, '\\n') != EOF) {\n \t\t\t\tstrbuf_trim(&confirm);\n-- \n2.3.0\n"},{"id":"256784","messageId":"CANYiYbGuRjNZARc278py=MzDDXukAfLJv3kWdnBa6_ia7WDvRg@mail.gmail.com","threadId":"38634","inReplyTo":"1425137944-13667-1-git-send-email-jn.avila@free.fr","subject":"Re: [PATCH] Add hint for translators for y/n reply.","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2015-03-01T00:18:48Z","receivedAt":"2015-03-01T00:18:48Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2015-02-28 23:39 GMT+08:00 Jean-Noel Avila <jn.avila@free.fr>:\n> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n> ---\n>  builtin/clean.c | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/builtin/clean.c b/builtin/clean.c\n> index 7e7fdcf..2c98661 100644\n> --- a/builtin/clean.c\n> +++ b/builtin/clean.c\n> @@ -754,6 +754,9 @@ static int ask_each_cmd(void)\n>                 /* Ctrl-D should stop removing files */\n>                 if (!eof) {\n>                         qname = quote_path_relative(item->string, NULL, &buf);\n> +                       /*TRANSLATORS: Make sure to include [Y] and [n] in your\n> +                       translation. The program will only accept English input\n> +                       at this point. */\n>                         printf(_(\"remove %s? \"), qname);\n\nYes, it may confuse.  In order to let the translators notice this and update,\nyou'd better change the code like this:\n\n        printf(_(\"remove %s [y/N]? \"), qname);\n\n\n-- \nJiang Xin\n"},{"id":"256785","messageId":"CANYiYbFs_-4B4dko-KE3Gi2hDoQ1DkyR1xNkVc+uwOQrtz3dVw@mail.gmail.com","threadId":"38634","inReplyTo":"CANYiYbGuRjNZARc278py=MzDDXukAfLJv3kWdnBa6_ia7WDvRg@mail.gmail.com","subject":"Re: [PATCH] Add hint for translators for y/n reply.","fromName":"Jiang Xin","fromEmail":"worldhello.net@gmail.com","sentAt":"2015-03-01T00:30:00Z","receivedAt":"2015-03-01T00:30:00Z","isPatch":true,"sender":{"key":"worldhello.net@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183860?v=4"},"body":"2015-03-01 8:18 GMT+08:00 Jiang Xin <worldhello.net@gmail.com>:\n> 2015-02-28 23:39 GMT+08:00 Jean-Noel Avila <jn.avila@free.fr>:\n>> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n>> ---\n>>  builtin/clean.c | 3 +++\n>>  1 file changed, 3 insertions(+)\n>>\n>> diff --git a/builtin/clean.c b/builtin/clean.c\n>> index 7e7fdcf..2c98661 100644\n>> --- a/builtin/clean.c\n>> +++ b/builtin/clean.c\n>> @@ -754,6 +754,9 @@ static int ask_each_cmd(void)\n>>                 /* Ctrl-D should stop removing files */\n>>                 if (!eof) {\n>>                         qname = quote_path_relative(item->string, NULL, &buf);\n>> +                       /*TRANSLATORS: Make sure to include [Y] and [n] in your\n>> +                       translation. The program will only accept English input\n>> +                       at this point. */\n>>                         printf(_(\"remove %s? \"), qname);\n>\n> Yes, it may confuse.  In order to let the translators notice this and update,\n> you'd better change the code like this:\n>\n>         printf(_(\"remove %s [y/N]? \"), qname);\n>\n\nWhat's more, you should capitalize the leading character letter of the\nword remove.\nMy English.\n\n>\n> --\n> Jiang Xin\n"},{"id":"256793","messageId":"xmqqa8zxgybr.fsf@gitster.dls.corp.google.com","threadId":"38634","inReplyTo":"CANYiYbGuRjNZARc278py=MzDDXukAfLJv3kWdnBa6_ia7WDvRg@mail.gmail.com","subject":"Re: [PATCH] Add hint for translators for y/n reply.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-01T04:02:00Z","receivedAt":"2015-03-01T04:02:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jiang Xin <worldhello.net@gmail.com> writes:\n\n> 2015-02-28 23:39 GMT+08:00 Jean-Noel Avila <jn.avila@free.fr>:\n>> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n>> ---\n>>  builtin/clean.c | 3 +++\n>>  1 file changed, 3 insertions(+)\n>>\n>> diff --git a/builtin/clean.c b/builtin/clean.c\n>> index 7e7fdcf..2c98661 100644\n>> --- a/builtin/clean.c\n>> +++ b/builtin/clean.c\n>> @@ -754,6 +754,9 @@ static int ask_each_cmd(void)\n>>                 /* Ctrl-D should stop removing files */\n>>                 if (!eof) {\n>>                         qname = quote_path_relative(item->string, NULL, &buf);\n>> +                       /*TRANSLATORS: Make sure to include [Y] and [n] in your\n>> +                       translation. The program will only accept English input\n>> +                       at this point. */\n\nA comment \"We will accept only y, Y, Ye, YE,... as 'affirmative'\" in\nthe code to translators will not help the end users at all, so make\nit a single liner like this:\n\n\t/* TRANSLATORS: make sure to keep [y/N] as-is */\n\nMake sure you have SP after slash-asterisk.\n\n>>                         printf(_(\"remove %s? \"), qname);\n>\n> Yes, it may confuse.  In order to let the translators notice this and update,\n> you'd better change the code like this:\n>\n>         printf(_(\"remove %s [y/N]? \"), qname);\n\nA very good suggestion.  The code that follows this part treats an\nempty input and a random non-empty input that does not head-match\n\"yes\" as \"please do not remove\"; upcasing N is a good visual hint\nthat that \"no\" is the default.\n\nThanks.\n"},{"id":"256801","messageId":"1425211105-18873-1-git-send-email-jn.avila@free.fr","threadId":"38634","inReplyTo":"1425137944-13667-1-git-send-email-jn.avila@free.fr","subject":"[PATCHv2] Add hint interactive cleaning","fromName":"Jean-Noel Avila","fromEmail":"jn.avila@free.fr","sentAt":"2015-03-01T11:58:25Z","receivedAt":"2015-03-01T11:58:25Z","isPatch":false,"sender":{"key":"jn.avila@free.fr","avatar":"https://avatars.githubusercontent.com/u/156172?v=4"},"body":"For translators, specify that a  y/N reply is needed.\n\nSigned-off-by: Jean-Noel Avila <jn.avila@free.fr>\n---\n builtin/clean.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/clean.c b/builtin/clean.c\nindex 7e7fdcf..98c103f 100644\n--- a/builtin/clean.c\n+++ b/builtin/clean.c\n@@ -754,7 +754,8 @@ static int ask_each_cmd(void)\n \t\t/* Ctrl-D should stop removing files */\n \t\tif (!eof) {\n \t\t\tqname = quote_path_relative(item->string, NULL, &buf);\n-\t\t\tprintf(_(\"remove %s? \"), qname);\n+\t\t\t/* TRANSLATORS: Make sure to keep [y/N] as is */\n+\t\t\tprintf(_(\"Remove %s [y/N]? \"), qname);\n \t\t\tif (strbuf_getline(&confirm, stdin, '\\n') != EOF) {\n \t\t\t\tstrbuf_trim(&confirm);\n \t\t\t} else {\n-- \n2.3.0\n"},{"id":"256854","messageId":"xmqq7fuzb344.fsf@gitster.dls.corp.google.com","threadId":"38634","inReplyTo":"1425211105-18873-1-git-send-email-jn.avila@free.fr","subject":"Re: [PATCHv2] Add hint interactive cleaning","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-03-02T19:39:39Z","receivedAt":"2015-03-02T19:39:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jean-Noel Avila <jn.avila@free.fr> writes:\n\n> For translators, specify that a  y/N reply is needed.\n>\n> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>\n> ---\n>  builtin/clean.c | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/builtin/clean.c b/builtin/clean.c\n> index 7e7fdcf..98c103f 100644\n> --- a/builtin/clean.c\n> +++ b/builtin/clean.c\n> @@ -754,7 +754,8 @@ static int ask_each_cmd(void)\n>  \t\t/* Ctrl-D should stop removing files */\n>  \t\tif (!eof) {\n>  \t\t\tqname = quote_path_relative(item->string, NULL, &buf);\n> -\t\t\tprintf(_(\"remove %s? \"), qname);\n> +\t\t\t/* TRANSLATORS: Make sure to keep [y/N] as is */\n> +\t\t\tprintf(_(\"Remove %s [y/N]? \"), qname);\n>  \t\t\tif (strbuf_getline(&confirm, stdin, '\\n') != EOF) {\n>  \t\t\t\tstrbuf_trim(&confirm);\n>  \t\t\t} else {\n\nThanks. All other interactive prompts from this command\n(i.e. menu_opts.prompt) seem to capitalize their first word, so\nupcasing this message is a good change, too.\n"}]}