git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Dimitriy Ryazantcev via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Jiang Xin <zhiyou.jx@alibaba-inc.com>,
	Junio C Hamano <gitster@pobox.com>,
	Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
Subject: Re: [PATCH v2] i18n: mark message helpers prefix for translation
Date: Wed, 22 Jun 2022 10:12:51 +0200	[thread overview]
Message-ID: <220622.86v8stkt1g.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <pull.1279.v2.git.git.1655819877758.gitgitgadget@gmail.com>


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).

  reply	other threads:[~2022-06-22  8:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=220622.86v8stkt1g.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=dimitriy.ryazantcev@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=zhiyou.jx@alibaba-inc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).