git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] l10n: mark message helpers prefix for translation.
@ 2022-06-21 13:50 Dimitriy Ryazantcev via GitGitGadget
  2022-06-21 13:57 ` [PATCH v2] i18n: " Dimitriy Ryazantcev via GitGitGadget
  2022-06-21 14:27 ` [PATCH] l10n: " Jiang Xin
  0 siblings, 2 replies; 6+ messages in thread
From: Dimitriy Ryazantcev via GitGitGadget @ 2022-06-21 13:50 UTC (permalink / raw)
  To: git; +Cc: Jiang Xin, Junio C Hamano, Dimitriy Ryazantcev,
	Dimitriy Ryazantcev

From: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>

Some messages prefixed like 'usage:'/'fatal:'/'warning:'/'error:'
were not translated.

Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
---
    l10n: mark message helpers prefix for translation.
    
    Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:' were
    not translated.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1279%2FDJm00n%2Fl10n-fixes-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1279/DJm00n/l10n-fixes-v1
Pull-Request: https://github.com/git/git/pull/1279

 usage.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usage.c b/usage.c
index 56e29d6cd6a..5a7c6c346c1 100644
--- a/usage.c
+++ b/usage.c
@@ -33,7 +33,7 @@ static void vreportf(const char *prefix, const char *err, va_list params)
 
 static NORETURN void usage_builtin(const char *err, va_list params)
 {
-	vreportf("usage: ", err, params);
+	vreportf(_("usage: "), err, params);
 
 	/*
 	 * When we detect a usage error *before* the command dispatch in
@@ -58,7 +58,7 @@ static NORETURN void usage_builtin(const char *err, va_list params)
 static void die_message_builtin(const char *err, va_list params)
 {
 	trace2_cmd_error_va(err, params);
-	vreportf("fatal: ", err, params);
+	vreportf(_("fatal: "), err, params);
 }
 
 /*
@@ -78,14 +78,14 @@ static void error_builtin(const char *err, va_list params)
 {
 	trace2_cmd_error_va(err, params);
 
-	vreportf("error: ", err, params);
+	vreportf(_("error: "), err, params);
 }
 
 static void warn_builtin(const char *warn, va_list params)
 {
 	trace2_cmd_error_va(warn, params);
 
-	vreportf("warning: ", warn, params);
+	vreportf(_("warning: "), warn, params);
 }
 
 static int die_is_recursing_builtin(void)

base-commit: 5b71c59bc3b9365075e2a175aa7b6f2b0c84ce44
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2] i18n: mark message helpers prefix for translation
  2022-06-21 13:50 [PATCH] l10n: mark message helpers prefix for translation Dimitriy Ryazantcev via GitGitGadget
@ 2022-06-21 13:57 ` Dimitriy Ryazantcev via GitGitGadget
  2022-06-22  8:12   ` Ævar Arnfjörð Bjarmason
  2022-06-21 14:27 ` [PATCH] l10n: " Jiang Xin
  1 sibling, 1 reply; 6+ messages in thread
From: Dimitriy Ryazantcev via GitGitGadget @ 2022-06-21 13:57 UTC (permalink / raw)
  To: git; +Cc: Jiang Xin, Junio C Hamano, Dimitriy Ryazantcev,
	Dimitriy Ryazantcev

From: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>

Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:'
were not translated.

Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
---
    i18n: mark message helpers prefix for translation
    
    Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:' were
    not translated.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1279%2FDJm00n%2Fl10n-fixes-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1279/DJm00n/l10n-fixes-v2
Pull-Request: https://github.com/git/git/pull/1279

Range-diff vs v1:

 1:  efcf217b361 ! 1:  6f389468631 l10n: mark message helpers prefix for translation.
     @@ Metadata
      Author: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
      
       ## Commit message ##
     -    l10n: mark message helpers prefix for translation.
     +    i18n: mark message helpers prefix for translation
      
     -    Some messages prefixed like 'usage:'/'fatal:'/'warning:'/'error:'
     +    Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:'
          were not translated.
      
          Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>


 usage.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usage.c b/usage.c
index 56e29d6cd6a..5a7c6c346c1 100644
--- a/usage.c
+++ b/usage.c
@@ -33,7 +33,7 @@ static void vreportf(const char *prefix, const char *err, va_list params)
 
 static NORETURN void usage_builtin(const char *err, va_list params)
 {
-	vreportf("usage: ", err, params);
+	vreportf(_("usage: "), err, params);
 
 	/*
 	 * When we detect a usage error *before* the command dispatch in
@@ -58,7 +58,7 @@ static NORETURN void usage_builtin(const char *err, va_list params)
 static void die_message_builtin(const char *err, va_list params)
 {
 	trace2_cmd_error_va(err, params);
-	vreportf("fatal: ", err, params);
+	vreportf(_("fatal: "), err, params);
 }
 
 /*
@@ -78,14 +78,14 @@ static void error_builtin(const char *err, va_list params)
 {
 	trace2_cmd_error_va(err, params);
 
-	vreportf("error: ", err, params);
+	vreportf(_("error: "), err, params);
 }
 
 static void warn_builtin(const char *warn, va_list params)
 {
 	trace2_cmd_error_va(warn, params);
 
-	vreportf("warning: ", warn, params);
+	vreportf(_("warning: "), warn, params);
 }
 
 static int die_is_recursing_builtin(void)

base-commit: 5b71c59bc3b9365075e2a175aa7b6f2b0c84ce44
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] l10n: mark message helpers prefix for translation.
  2022-06-21 13:50 [PATCH] l10n: mark message helpers prefix for translation Dimitriy Ryazantcev via GitGitGadget
  2022-06-21 13:57 ` [PATCH v2] i18n: " Dimitriy Ryazantcev via GitGitGadget
@ 2022-06-21 14:27 ` Jiang Xin
  1 sibling, 0 replies; 6+ messages in thread
From: Jiang Xin @ 2022-06-21 14:27 UTC (permalink / raw)
  To: Dimitriy Ryazantcev via GitGitGadget
  Cc: Git List, Jiang Xin, Junio C Hamano, Dimitriy Ryazantcev

On Tue, Jun 21, 2022 at 10:13 PM Dimitriy Ryazantcev via GitGitGadget
<gitgitgadget@gmail.com> wrote:
>
> From: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
>
> Some messages prefixed like 'usage:'/'fatal:'/'warning:'/'error:'
> were not translated.
>
> Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
> ---
>     l10n: mark message helpers prefix for translation.

1. The prefix of the subject should be "i18n", because your are
marking strings for translation.
2. The subject line should not end with a period.

>     Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:' were
>     not translated.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1279%2FDJm00n%2Fl10n-fixes-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1279/DJm00n/l10n-fixes-v1
> Pull-Request: https://github.com/git/git/pull/1279

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] i18n: mark message helpers prefix for translation
  2022-06-21 13:57 ` [PATCH v2] i18n: " Dimitriy Ryazantcev via GitGitGadget
@ 2022-06-22  8:12   ` Ævar Arnfjörð Bjarmason
  2022-06-22 15:23     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-06-22  8:12 UTC (permalink / raw)
  To: Dimitriy Ryazantcev via GitGitGadget
  Cc: git, Jiang Xin, Junio C Hamano, Dimitriy Ryazantcev


On Tue, Jun 21 2022, Dimitriy Ryazantcev via GitGitGadget wrote:

> From: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
>
> Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:'
> were not translated.
>
> Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
> ---
>     i18n: mark message helpers prefix for translation
>     
>     Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:' were
>     not translated.
>
> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1279%2FDJm00n%2Fl10n-fixes-v2
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1279/DJm00n/l10n-fixes-v2
> Pull-Request: https://github.com/git/git/pull/1279
>
> Range-diff vs v1:
>
>  1:  efcf217b361 ! 1:  6f389468631 l10n: mark message helpers prefix for translation.
>      @@ Metadata
>       Author: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
>       
>        ## Commit message ##
>      -    l10n: mark message helpers prefix for translation.
>      +    i18n: mark message helpers prefix for translation
>       
>      -    Some messages prefixed like 'usage:'/'fatal:'/'warning:'/'error:'
>      +    Some messages prefixes like 'usage:'/'fatal:'/'warning:'/'error:'
>           were not translated.
>       
>           Signed-off-by: Dimiytriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
>
>
>  usage.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/usage.c b/usage.c
> index 56e29d6cd6a..5a7c6c346c1 100644
> --- a/usage.c
> +++ b/usage.c
> @@ -33,7 +33,7 @@ static void vreportf(const char *prefix, const char *err, va_list params)
>  
>  static NORETURN void usage_builtin(const char *err, va_list params)
>  {
> -	vreportf("usage: ", err, params);
> +	vreportf(_("usage: "), err, params);
>  
>  	/*
>  	 * When we detect a usage error *before* the command dispatch in
> @@ -58,7 +58,7 @@ static NORETURN void usage_builtin(const char *err, va_list params)
>  static void die_message_builtin(const char *err, va_list params)
>  {
>  	trace2_cmd_error_va(err, params);
> -	vreportf("fatal: ", err, params);
> +	vreportf(_("fatal: "), err, params);
>  }
>  
>  /*
> @@ -78,14 +78,14 @@ static void error_builtin(const char *err, va_list params)
>  {
>  	trace2_cmd_error_va(err, params);
>  
> -	vreportf("error: ", err, params);
> +	vreportf(_("error: "), err, params);
>  }
>  
>  static void warn_builtin(const char *warn, va_list params)
>  {
>  	trace2_cmd_error_va(warn, params);
>  
> -	vreportf("warning: ", warn, params);
> +	vreportf(_("warning: "), warn, params);
>  }
>  
>  static int die_is_recursing_builtin(void)

I posted this patch[1] to do the same a while ago, except it also
translates the "BUG: " message:
https://lore.kernel.org/git/RFC-patch-20.21-69426ddb992-20211115T220831Z-avarab@gmail.com/;
I was meaning to submit it sometime soon, one thing it depended on was
the recently merged ab/bug-if-bug series (4da14b574f2 (Merge branch
'ab/bug-if-bug', 2022-06-10)).

It's more complex because it's handling the "BUG: " case, and was part
of a more general change to allow us to emit file & line numbers (as
with "BUG: ") for these usage/fatal/error/warning messages.

That being said I don't mind this smaller change going in first, but
it's perhaps worth noting that you're explicitly omitting one "message
helper" variant (BUG), and that unlike for most i18n messages this one
uses "lego", i.e. forces the message order to be LTR, so we'll still
need to further adjust this for RTL languages (the same is the case with
my patch).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] i18n: mark message helpers prefix for translation
  2022-06-22  8:12   ` Ævar Arnfjörð Bjarmason
@ 2022-06-22 15:23     ` Junio C Hamano
  2022-06-22 15:33       ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2022-06-22 15:23 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Dimitriy Ryazantcev via GitGitGadget, git, Jiang Xin,
	Dimitriy Ryazantcev

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> I posted this patch[1] to do the same a while ago, except it also
> translates the "BUG: " message:

We should take this one, exactly because it does not touch BUG();
the messages given to BUG() are not marked for translation, and
translating only the "BUG:" prefix does not make much sense.

When BUG messages are shown, it is better if they are conveyed back
to us exactly.  It would be cumbersome to near-impossible, depending
on the language, if a message was given back to me in a script that
I do not even know how to type---I'd need to map it back via po/*
files with "grep" to locate where the message came from.

Besides, BUG messages are meant not to be seen.  We could discuss if
it makes more sense to translate the messages and spend engineering
resource to mark them with _() while massaging the messages to help
deduping, but because the messages are meant primarily for identifying
the locations and not explaining situation to human user, I do not see
a huge benefit doing so.

Thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] i18n: mark message helpers prefix for translation
  2022-06-22 15:23     ` Junio C Hamano
@ 2022-06-22 15:33       ` Ævar Arnfjörð Bjarmason
  0 siblings, 0 replies; 6+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2022-06-22 15:33 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Dimitriy Ryazantcev via GitGitGadget, git, Jiang Xin,
	Dimitriy Ryazantcev


On Wed, Jun 22 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> I posted this patch[1] to do the same a while ago, except it also
>> translates the "BUG: " message:
>
> We should take this one, exactly because it does not touch BUG();
> the messages given to BUG() are not marked for translation, and
> translating only the "BUG:" prefix does not make much sense.
>
> When BUG messages are shown, it is better if they are conveyed back
> to us exactly.  It would be cumbersome to near-impossible, depending
> on the language, if a message was given back to me in a script that
> I do not even know how to type---I'd need to map it back via po/*
> files with "grep" to locate where the message came from.
>
> Besides, BUG messages are meant not to be seen.  We could discuss if
> it makes more sense to translate the messages and spend engineering
> resource to mark them with _() while massaging the messages to help
> deduping, but because the messages are meant primarily for identifying
> the locations and not explaining situation to human user, I do not see
> a huge benefit doing so.

I think this smaller change is fine, I was attempting to summarize the
difference in the approaches, and note that it would be useful if the
commit message communicated some of what you're pointing out here.

The change I have didn't translate the *content* of bug messages (which
we'd need to mark for translation, but we shouldn't do that), just the
"BUG: " prefix, and we'd still leave the file/line number in place.

It's probably going overboard, but it seemed harmless enough, and might
help us get reports we otherwise wouldn't see, as someone who doesn't
speak any English would get the hint.

I realize that git's userbase is fairly technical, and if you're finding
a bug in git you're likely to have some *basic* knowledge of English.

But I think it's good translation practice to not assume that, and to
make the software inviting to people who speak about as much English as
I speak Chinese, i.e. none.

If I was using software originally written in Chinese that had *.po
translations in a language I understood I'd be thoroughly confused if
one day it would tell me:

    昆虫 git.c:123:晦涩难懂的问题

Which I don't even understand one letter of, and I have no idea if it's
grammatically correct. It's just what I get from Google translate if I
ask it to translate "insect: obscure problem".

I'd probably try to copy/paste at least "昆虫", and get an even more
puzzling mention of "insect". Which is what many such users would be
likely to get if they were trying to find out what our "BUG" means, the
idiom of "[a] software bug" is jargon that would translate especially
badly.

So, wouldn't that be more helpful if I'd at least get:

    INTERNAL SOFTWARE ERROR git.c:123:晦涩难懂的问题

So that was the idea.

I know it's an uphill battle sometimes to convince people that there are
a) monolinguals that b) use complex software and c) whose native
language isn't the one we use on this ML. But these people do in fact
exist, and in quite large numbers I might add :)

I think our i18n effort should aim to target that lowest common
denominator, there's other lower hanging fruit, but since we were on the
subject...

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-22 15:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 13:50 [PATCH] l10n: mark message helpers prefix for translation Dimitriy Ryazantcev via GitGitGadget
2022-06-21 13:57 ` [PATCH v2] i18n: " Dimitriy Ryazantcev via GitGitGadget
2022-06-22  8:12   ` Ævar Arnfjörð Bjarmason
2022-06-22 15:23     ` Junio C Hamano
2022-06-22 15:33       ` Ævar Arnfjörð Bjarmason
2022-06-21 14:27 ` [PATCH] l10n: " Jiang Xin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).