On 2026-Apr-23, Peter Smith wrote: > v2 removes translation of the comma separator, due to the discussion > over at [1].
Hmm, at least Japanese uses a different character for commas, and apparently French likes to add a space, so I think this is a bad move. I think we could handle these things by including the comma together with the literal in each element of the list being constructed, as in the attached. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
>From 8b92dce1a64d623e76019a4b83576458defd63e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <[email protected]> Date: Thu, 23 Apr 2026 11:10:54 +0200 Subject: [PATCH] change translation markers in GetPublicationsStr --- src/backend/catalog/pg_subscription.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/backend/catalog/pg_subscription.c b/src/backend/catalog/pg_subscription.c index 1f1fdc75af6..d1e2e9de468 100644 --- a/src/backend/catalog/pg_subscription.c +++ b/src/backend/catalog/pg_subscription.c @@ -41,31 +41,36 @@ static List *textarray_to_stringlist(ArrayType *textarray); /* * Add a comma-separated list of publication names to the 'dest' string. + * + * If quote_literal is true, the returned list can be used to construct an SQL + * command, thus no translation is applied. Otherwise, the string can be used + * to create a user-facing message, so translatable quote marks are added. */ void GetPublicationsStr(List *publications, StringInfo dest, bool quote_literal) { ListCell *lc; - bool first = true; + int length = list_length(publications); Assert(publications != NIL); foreach(lc, publications) { char *pubname = strVal(lfirst(lc)); - - if (first) - first = false; - else - appendStringInfoString(dest, ", "); + bool last = foreach_current_index(lc) >= length - 1; if (quote_literal) + { appendStringInfoString(dest, quote_literal_cstr(pubname)); + if (!last) + appendStringInfoString(dest, ", "); + } else { - appendStringInfoChar(dest, '"'); - appendStringInfoString(dest, pubname); - appendStringInfoChar(dest, '"'); + if (last) + appendStringInfo(dest, _("\"%s\""), pubname); + else + appendStringInfo(dest, _("\"%s\", "), pubname); } } } -- 2.47.3
