Pierre-Olivier Vares [off-list ref] 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.
Le 24/02/2015 21:32, Junio C Hamano a écrit :
quoted
- 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
Signed-off-by: Jean-Noel Avila <redacted>
---
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
2015-02-28 23:39 GMT+08:00 Jean-Noel Avila [off-list ref]:
quoted hunk
Signed-off-by: Jean-Noel Avila <redacted>
---
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
2015-03-01 8:18 GMT+08:00 Jiang Xin [off-list ref]:
2015-02-28 23:39 GMT+08:00 Jean-Noel Avila [off-list ref]:
quoted
Signed-off-by: Jean-Noel Avila <redacted>
---
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
For translators, specify that a y/N reply is needed.
Signed-off-by: Jean-Noel Avila <redacted>
---
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