Thread (3 messages) 3 messages, 2 authors, 2024-05-25
DORMANTno replies

[PATCH 2 1/1] parse-options: allow localized substitution hints in macros

From: Alexander Shopov <hidden>
Date: 2024-05-25 12:25:29
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

i18n: expose substitution hint chars in functions and macros to translators

Signed-off-by: Alexander Shopov <redacted>
---
 parse-options.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index 30b9e68f8a..06d962b00e 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -1070,11 +1070,17 @@ 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: change `<>' to other characters or leave as is */
+			  _("[=<%s>]");
 		else
-			s = literal ? "[%s]" : "[<%s>]";
+			s = literal ? "[%s]" :
+			  /* TRANSLATORS: change `<>' to other characters or leave as is */
+			  _("[<%s>]");
 	else
-		s = literal ? " %s" : " <%s>";
+		s = literal ? " %s" :
+		  /* TRANSLATORS: change `<>' to other characters or leave as is */
+		  _(" <%s>");
 	return utf8_fprintf(outfile, s, opts->argh ? _(opts->argh) : _("..."));
 }
 
-- 
2.45.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help