* Internationalization and yes/no prompts
[not found] <20150212085211.9112780692@smtp-out.fingerprint.fr>
@ 2015-02-23 15:46 ` Pierre-Olivier Vares
2015-02-24 20:32 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: Pierre-Olivier Vares @ 2015-02-23 15:46 UTC (permalink / raw)
To: git
Hi,
I just fell in a little trap, in which you may find interest.
I'm using git on the command line (on an Elementary OS system : Linux
3.2.0-76-generic #111-Ubuntu SMP Tue Jan 13 22:16:09 UTC 2015 x86_64
x86_64 x86_64 GNU/Linux).
git version : 2.3.0
My system is configured in french.
That's said :
I run a git clean -i, and select option 4 (ask each).
(By the fact, messages are translated, but options of the
'interactive' menu aren't)
So I get, for each file, the question :
/Supprimer //premier_fichier ? [Remove first_file ?]/
Natural answer to this question is 'Oui' [Yes], so I type 'o', rather
than 'y'.
Once finished, I see no file has been removed (since 'o' has been
considered as 'different than yes')
Whereas it's not an end-of-the-world thing*, it's annoying as at first
sight I didn't understand why it has 'not worked'.
I thought of a few possibilities (some easy to implement, others more
complex; some are stricter for the user) :
- explicitly put "y/n" in the message. Translaters should be warned to
let "y/n",
- only allow y and n answers (and variants : yes, no), and reject
everything else with a message
- use as 'n', but echoes a message : 'Answer considered as /no/'
- accept answers depending on the language used to echo the prompt (y/n
for english, o/n for french, j/n for german, ...)
What do you think about that ?
* but just imagine how worst it could be if you're configured in a
language where 'No' is said using a word beginning by 'Y'...
Cheers,
Pierre-Olivier Vares
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Internationalization and yes/no prompts
2015-02-23 15:46 ` Internationalization and yes/no prompts Pierre-Olivier Vares
@ 2015-02-24 20:32 ` Junio C Hamano
2015-02-25 9:42 ` Jean-Noël Avila
2015-02-28 15:39 ` [PATCH] Add hint for translators for y/n reply Jean-Noel Avila
0 siblings, 2 replies; 9+ messages in thread
From: Junio C Hamano @ 2015-02-24 20:32 UTC (permalink / raw)
To: Pierre-Olivier Vares; +Cc: git
Pierre-Olivier Vares <pierre-olivier.vares@fingerprint.fr> writes:
> /Supprimer //premier_fichier ? [Remove first_file ?]/
> Natural answer to this question is 'Oui' [Yes], so I type 'o', rather
> than 'y'.
> Once finished, I see no file has been removed (since 'o' has been
> considered as 'different than yes')
> Whereas it's not an end-of-the-world thing*, it's annoying as at first
> sight I didn't understand why it has 'not worked'.
>
> I thought of a few possibilities (some easy to implement, others more
> complex; some are stricter for the user) :
> - explicitly put "y/n" in the message. Translaters should be warned to
> let "y/n",
This may be suboptimal from the end-user's point of view, but it is
the least risky of breaking anything.
And it is way better than the status quo.
> - only allow y and n answers (and variants : yes, no), and reject
> everything else with a message
This is not helpful to the users if it does not say why (O)ui was
rejected, which would mean we would be better off saying [Y/n] in
the message in the first place.
> - use as 'n', but echoes a message : 'Answer considered as /no/'
Unhelpful without stating why (O)ui was considered as 'no'; same
conclusion as above.
> - accept answers depending on the language used to echo the prompt
> (y/n for english, o/n for french, j/n for german, ...)
This would be the best for languages where translations for Yes and
No begin with different letters, but I suspect it might be tricky to
implement.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Internationalization and yes/no prompts
2015-02-24 20:32 ` Junio C Hamano
@ 2015-02-25 9:42 ` Jean-Noël Avila
2015-02-28 15:39 ` [PATCH] Add hint for translators for y/n reply Jean-Noel Avila
1 sibling, 0 replies; 9+ messages in thread
From: Jean-Noël Avila @ 2015-02-25 9:42 UTC (permalink / raw)
To: Junio C Hamano, Pierre-Olivier Vares; +Cc: git
Le 24/02/2015 21:32, Junio C Hamano a écrit :
>> - explicitly put "y/n" in the message. Translaters should be warned to
>> let "y/n",
> This may be suboptimal from the end-user's point of view, but it is
> the least risky of breaking anything.
>
> And it is way better than the status quo.
>
>
I can push a small update for this one.
The "yes" string could be translated in builtin/clean.c
Are there other places where a translated part asks explicitly for a
yes/no reply? It is not clear from the content of the po file.
BR
Jean-Noël
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] Add hint for translators for y/n reply.
2015-02-24 20:32 ` Junio C Hamano
2015-02-25 9:42 ` Jean-Noël Avila
@ 2015-02-28 15:39 ` Jean-Noel Avila
2015-03-01 0:18 ` Jiang Xin
2015-03-01 11:58 ` [PATCHv2] Add hint interactive cleaning Jean-Noel Avila
1 sibling, 2 replies; 9+ messages in thread
From: Jean-Noel Avila @ 2015-02-28 15:39 UTC (permalink / raw)
To: git; +Cc: Jean-Noel Avila
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. */
printf(_("remove %s? "), qname);
if (strbuf_getline(&confirm, stdin, '\n') != EOF) {
strbuf_trim(&confirm);
--
2.3.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] Add hint for translators for y/n reply.
2015-02-28 15:39 ` [PATCH] Add hint for translators for y/n reply Jean-Noel Avila
@ 2015-03-01 0:18 ` Jiang Xin
2015-03-01 0:30 ` Jiang Xin
2015-03-01 4:02 ` Junio C Hamano
2015-03-01 11:58 ` [PATCHv2] Add hint interactive cleaning Jean-Noel Avila
1 sibling, 2 replies; 9+ messages in thread
From: Jiang Xin @ 2015-03-01 0:18 UTC (permalink / raw)
To: Jean-Noel Avila; +Cc: Git List
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. */
> 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);
--
Jiang Xin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Add hint for translators for y/n reply.
2015-03-01 0:18 ` Jiang Xin
@ 2015-03-01 0:30 ` Jiang Xin
2015-03-01 4:02 ` Junio C Hamano
1 sibling, 0 replies; 9+ messages in thread
From: Jiang Xin @ 2015-03-01 0:30 UTC (permalink / raw)
To: Jean-Noel Avila; +Cc: Git List
2015-03-01 8:18 GMT+08:00 Jiang Xin <worldhello.net@gmail.com>:
> 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. */
>> 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);
>
What's more, you should capitalize the leading character letter of the
word remove.
My English.
>
> --
> Jiang Xin
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] Add hint for translators for y/n reply.
2015-03-01 0:18 ` Jiang Xin
2015-03-01 0:30 ` Jiang Xin
@ 2015-03-01 4:02 ` Junio C Hamano
1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2015-03-01 4:02 UTC (permalink / raw)
To: Jiang Xin; +Cc: Jean-Noel Avila, Git List
Jiang Xin <worldhello.net@gmail.com> writes:
> 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.
>> 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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCHv2] Add hint interactive cleaning
2015-02-28 15:39 ` [PATCH] Add hint for translators for y/n reply Jean-Noel Avila
2015-03-01 0:18 ` Jiang Xin
@ 2015-03-01 11:58 ` Jean-Noel Avila
2015-03-02 19:39 ` Junio C Hamano
1 sibling, 1 reply; 9+ messages in thread
From: Jean-Noel Avila @ 2015-03-01 11:58 UTC (permalink / raw)
To: git; +Cc: Jean-Noel Avila
For translators, specify that a y/N reply is needed.
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
---
builtin/clean.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/builtin/clean.c b/builtin/clean.c
index 7e7fdcf..98c103f 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -754,7 +754,8 @@ static int ask_each_cmd(void)
/* Ctrl-D should stop removing files */
if (!eof) {
qname = quote_path_relative(item->string, NULL, &buf);
- printf(_("remove %s? "), qname);
+ /* TRANSLATORS: Make sure to keep [y/N] as is */
+ printf(_("Remove %s [y/N]? "), qname);
if (strbuf_getline(&confirm, stdin, '\n') != EOF) {
strbuf_trim(&confirm);
} else {
--
2.3.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCHv2] Add hint interactive cleaning
2015-03-01 11:58 ` [PATCHv2] Add hint interactive cleaning Jean-Noel Avila
@ 2015-03-02 19:39 ` Junio C Hamano
0 siblings, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2015-03-02 19:39 UTC (permalink / raw)
To: Jean-Noel Avila; +Cc: git
Jean-Noel Avila <jn.avila@free.fr> writes:
> For translators, specify that a y/N reply is needed.
>
> Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
> ---
> builtin/clean.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/clean.c b/builtin/clean.c
> index 7e7fdcf..98c103f 100644
> --- a/builtin/clean.c
> +++ b/builtin/clean.c
> @@ -754,7 +754,8 @@ static int ask_each_cmd(void)
> /* Ctrl-D should stop removing files */
> if (!eof) {
> qname = quote_path_relative(item->string, NULL, &buf);
> - printf(_("remove %s? "), qname);
> + /* TRANSLATORS: Make sure to keep [y/N] as is */
> + printf(_("Remove %s [y/N]? "), qname);
> if (strbuf_getline(&confirm, stdin, '\n') != EOF) {
> strbuf_trim(&confirm);
> } else {
Thanks. All other interactive prompts from this command
(i.e. menu_opts.prompt) seem to capitalize their first word, so
upcasing this message is a good change, too.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2015-03-02 19:39 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20150212085211.9112780692@smtp-out.fingerprint.fr>
2015-02-23 15:46 ` Internationalization and yes/no prompts Pierre-Olivier Vares
2015-02-24 20:32 ` Junio C Hamano
2015-02-25 9:42 ` Jean-Noël Avila
2015-02-28 15:39 ` [PATCH] Add hint for translators for y/n reply Jean-Noel Avila
2015-03-01 0:18 ` Jiang Xin
2015-03-01 0:30 ` Jiang Xin
2015-03-01 4:02 ` Junio C Hamano
2015-03-01 11:58 ` [PATCHv2] Add hint interactive cleaning Jean-Noel Avila
2015-03-02 19:39 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.