threads / patch / 61349

patchConsistency for substitution hints (i18n) 0/1

Subject: [PATCH] Consistency for substitution hints (i18n) 0/1

## tl;dr

2 messages between Apr 21, 2024 and Apr 21, 2024. Diffs are folded; open one to read it.

replies: 1people: 1as markdown or json

Alexander Shopov· Apr 21, 2024, 18:04 UTC · lore

In previous patches translators were allowed to use characters different than `<>' for pointers for substitution. In particular non-latin languages can skip such characters altogether. This enables this functionality for parse-options

Alexander Shopov (1):
  parse-options: use localized substitution hints
 parse-options.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
-- 
2.44.0
Alexander Shopov· Apr 21, 2024, 18:04 UTC · re: Alexander Shopov · lore

[[PATCH] Consistency for substitution hints (i18n) 1/1] parse-options: use localized substitution hints

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 | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
Show changes to parse-options.c +14 −3
diff --git a/parse-options.c b/parse-options.c
index 63a99dea6e..93712c6904 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -27,6 +27,7 @@ static void optbug(const struct option *opt, const char *reason)
 }
 
 static const char *optname(const struct option *opt, enum opt_parsed flags)
+// FIXME
 {
 	static struct strbuf sb = STRBUF_INIT;
 
@@ -1055,17 +1056,27 @@ int parse_options(int argc, const char **argv,
 }
 
 static int usage_argh(const struct option *opts, FILE *outfile)
+/// Fixme
 {
 	const char *s;
 	int literal = (opts->flags & PARSE_OPT_LITERAL_ARGHELP) ||
 		!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

← back to recent threads