Subject: Re: [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints

From: Junio C Hamano <[email-masked]>
Date: Sun, 21 Apr 2024 12:33:18 -0700

Alexander Shopov <[email-masked]> writes:

> i18n: as translators choose substitution hints applicable
> to their writing system, expose the ones in parse-options
> for completeness

Please do not mark a patch whose contents has changed with "RESUBMIT"
and the like.  The earlier ones you had had unwanted "// Fixme" left
in the patch and I am guessing that this version has removed them?
Those who have read the earlier one, when the see the RESUBMIT in
the title, would probably have ignored the patch and wouldn't have
noticed that this one is improved over the previous attempts.

As to what the patch tries to achieve, I do not have a strong
opinion, but the title and the explanation of the patch in the
proposed log message looked somewhat strange, and the newly added
comments looked overly long, all of which you may want to correct
when you send out "[PATCH v2]".

Thanks.

> Signed-off-by: Alexander Shopov <[email-masked]>
> ---
>  parse-options.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/parse-options.c b/parse-options.c
> index 63a99dea6e..2362ca83f3 100644
> --- a/parse-options.c
> +++ b/parse-options.c
> @@ -1061,11 +1061,20 @@ static int usage_argh(const struct option *opts, FILE *outfile)
>  		!opts->argh || !!strpbrk(opts->argh, "()<>[]|");
>  	if (opts->flags & PARSE_OPT_OPTARG)
>  		if (opts->long_name)
> -			s = literal ? "[=%s]" : "[=<%s>]";
> +			s = literal ? "[=%s]" :
> +			  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'
> +			     in which case use those */
> +			  _("[=<%s>]");
>  		else
> -			s = literal ? "[%s]" : "[<%s>]";
> +			s = literal ? "[%s]" :
> +			  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'
> +			     in which case use those */
> +			  _("[<%s>]");
>  	else
> -		s = literal ? " %s" : " <%s>";
> +		s = literal ? " %s" :
> +		  /* TRANSLATORS: keep as is unless you use hints for substitution other than `<>'
> +		     in which case use those */
> +		  _(" <%s>");
>  	return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _("..."));
>  }