git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1]
@ 2024-04-21 19:14 Alexander Shopov
  2024-04-21 19:14 ` [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints Alexander Shopov
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shopov @ 2024-04-21 19:14 UTC (permalink / raw)
  To: git, gitster, worldhello.net; +Cc: Alexander Shopov

Hopefully this is the 3rd time and I will do it right

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

Alexander Shopov (1):
  parse-options: use localized substitution hints

 parse-options.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

-- 
2.44.0


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

* [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1]  parse-options: use localized substitution hints
  2024-04-21 19:14 [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1] Alexander Shopov
@ 2024-04-21 19:14 ` Alexander Shopov
  2024-04-21 19:33   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shopov @ 2024-04-21 19:14 UTC (permalink / raw)
  To: git, gitster, worldhello.net; +Cc: Alexander Shopov

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

Signed-off-by: Alexander Shopov <ash@kambanaria.org>
---
 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) : _("..."));
 }
 
-- 
2.44.0


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

* Re: [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1]  parse-options: use localized substitution hints
  2024-04-21 19:14 ` [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints Alexander Shopov
@ 2024-04-21 19:33   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2024-04-21 19:33 UTC (permalink / raw)
  To: Alexander Shopov; +Cc: git, worldhello.net

Alexander Shopov <ash@kambanaria.org> 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 <ash@kambanaria.org>
> ---
>  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) : _("..."));
>  }

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

end of thread, other threads:[~2024-04-21 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-21 19:14 [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 0/1] Alexander Shopov
2024-04-21 19:14 ` [[PATCH] [RESUBMIT 2nd] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints Alexander Shopov
2024-04-21 19:33   ` Junio C Hamano

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 NNTP newsgroup(s).