Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoRA-005Zsn-1p for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:25:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFoR9-000K8b-2W for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:25:23 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wFoR9-000K8T-1P for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:25:23 +0000 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFoR6-00000002bq3-47v3 for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:25:23 +0000 Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-50fbd79350dso22180091cf.3 for ; Thu, 23 Apr 2026 00:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776929117; cv=none; d=google.com; s=arc-20240605; b=I+aHAQDtf8YalMEInNlil7d6lv9E5XMPqNwersbX2SbGb/W3vyNfkuK4fuBTcM9iXD 9I0hn+LdTLeLFGZyOUM8cqq0wuuK0bMz5yqLQ3uX2DLPBN0IDF3UOfXkQGIj9/aVO/7r kvWKU0tdcfHbPVFihbhPZ6REWmonpShc6rieyQ7OnBvoKmrCKGhSH5SKBl3L7ARHZvld 34ClbGMlpIOaT3iUoeouGZAj8hTEwJkRe4wxR3fhf+YfR43a1rlg+T6sFP1Z4h99l+eL isaRf5bF0PFaPVPzc966k1/RspGyRSN18M/VwRwe2jDoueYbGdQs22iyQrtUocbBUbRQ bIAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=SS3UMibePg7cZLURl7ph5Wxens+FzrH1bsTIvSweg84=; fh=tvS4T4+oR2J2hxK5aNJGfORVVBBvqUJPnvm76ijROZw=; b=aOslBDeIkVYZuJbm7TQQviHpSBPCjVgKajhLz9h8HFdU/KZy8pVarzLrw1JOp8Q6hE ZHs5mDVvAjOW7ke0pEibINFT87zPg2GQkMyOuWI7gCwXAudAynLwahhjkTnOmePBhc0T t5M5MrDmCdlwHzn9zhuXiVxNCREafvck5PUWxOLaatRo+s2cVXw7mvUed4CaZIK6NcIH ng7+G4sghVD/qyc6rvyymWzD/cXKRekeao3ct6gTNdYKnRC/QJUbrh45aSFhQZ5QNSrv UEsPzDY8SzradBpPQtLXfUYBRdowV5ItOemJMbVDtuUTNx44W8oFy1RdbGVcQSEwYXhS JyOg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776929117; x=1777533917; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SS3UMibePg7cZLURl7ph5Wxens+FzrH1bsTIvSweg84=; b=KNyUe+Gz2inZXAE0sS2ycfSivzwkJwsUPOvlWQc3L7i56+V3M+gfZoU5VPb7lqZANM hssZqBkP05oLMQkE8SRZn6udgat+KC6oq0RfL2N+18VoPQnaqNAmyXrpxjk27nJiavbg 2XagJHQUiYMe6aAx9yVSw9SpQXui4iUgcD8Cll0QMkLg33LPFBFH5xbKSZUH39j1gYlZ AkIQSlmNTJLZufJLG9uydMxX1/Pz3jNYbYVr7vvdBWcM4uXrPMvT4nPSBGbGkQ3ykyOI vcukyHQoY6YPVTsRuyL531OtrJCqFmBhw9PHwBfxvJqfS72K89uieR3An5uOFeIzfSf0 fgQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776929117; x=1777533917; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SS3UMibePg7cZLURl7ph5Wxens+FzrH1bsTIvSweg84=; b=rqAvlxX1ClHzXvCbm82va/aOA9iH9OiqbZ07vOSM0ObJxezMqExlvaamZJ34hQseGH WMATyxsW9XkC5QYM76C59J7Iu9vypH9JAyGCCVw8svVeEB6KhB6Vk/eeACqvj+SOht2W XDabzGmFk4BMxsJdsR1IdbmVucwtWtdjtYfL/iInGe7je3WBJSwT92CXqYyWO5IL1xGO 4qlv+d4woVnxXT1kziXtfdC+qOatbRbflV7AJThagqNr7WMUAuugzu1ydmhT+FloDYV8 wpNAuOSpwcLEHWLrLfUUI4R5WwCQu/64JUgwjMW122gR9ykfS0EFYMkK8ZkBTVYZekeW g8wA== X-Gm-Message-State: AOJu0Yx2EYV0LWyvTjyK29pXuogQAcIzPPei+ZrwoyDUb32zk7i3y5t3 McFoVwy7VtejPDVyR7VPtAAe3K8heO8HEVKGp4ixYefDLJYwCyRP9Xij03KWEkXW6h1l9T4AnTn t+U87muw+Oo/M3qPsmN29RDMCgbn94Gk= X-Gm-Gg: AeBDietPdxLd3ItC1wy0PA3wvVCtgwnj2dHqL1kfs0xL5AKSESbef24SqahHhbFpPFe jr7ZqWOInHVjsnhckZQuIe1/mZtqtZ32nX6zrMFPbvYJwaFf2MPaya1diDfzzHeJcEQK2J9JJ6/ q7JkHXSzVpv8kiRWNxCIYsEXNFyot7OfZaSBUve9eAYPk6vu4yW09NtcQkcU9nkGjzCYUqoV7i2 DNJEgZ+fa7l5Ala7t/+/vikLyyplh0X8HgJFz2J62AxvxF9V5t/EF9QTpqMVXEw4t3b+u8qQuPX LVNgSsCctQF5s1kFsw== X-Received: by 2002:ac8:5f06:0:b0:50d:a301:2fc0 with SMTP id d75a77b69052e-50e36b7a8fdmr376857391cf.26.1776929117225; Thu, 23 Apr 2026 00:25:17 -0700 (PDT) MIME-Version: 1.0 References: <202604011144.jeo56tazdx6z@alvherre.pgsql> In-Reply-To: From: Peter Smith Date: Thu, 23 Apr 2026 17:24:49 +1000 X-Gm-Features: AQROBzD0TWixSEk0osGkrd3eXRpsDRTlJG9pCKOulu0_-vTaNxsUzFokafQQKFc Message-ID: Subject: Re: Redundant/mis-use of _(x) gettext macro? To: =?UTF-8?Q?=C3=81lvaro_Herrera?= Cc: PostgreSQL Hackers Content-Type: multipart/mixed; boundary="000000000000d3093406501b8c94" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d3093406501b8c94 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Apr 7, 2026 at 3:05=E2=80=AFPM Peter Smith = wrote: > > On Wed, Apr 1, 2026 at 10:52=E2=80=AFPM =C3=81lvaro Herrera wrote: > > > > On 2026-Apr-01, Peter Smith wrote: > > > > > Hi. > > > > > > As originally reported [1] in the EXCEPT (TABLE ...) thread, I felt > > > the _() gettext macro is mis-used when it contains nothing but a > > > quoted format string. > > > > No, you feel wrong -- this is necessary so that the translator has > > control over the quoting style of a list of items. Not all translation= s > > use double quoting. Some examples from different language files: > > > > msgstr "unbekannte Komprimierungsoption: =C2=BB%s=C2=AB" > > msgstr "opci=C3=B3n de compresi=C3=B3n no reconocida: =C2=AB%s=C2=BB" > > msgstr "option de compression inconnue : =C2=AB %s =C2=BB" > > msgstr "tidak dapat menentukan encoding untuk lokal =C2=AB %s =C2=BB : = codesetnya adalah =C2=AB %s =C2=BB" > > > > The explanation [1] that even the comma separators and the quotes are > translatable parts of the message reminded me to revisit the > `GetPublicationsStr` function. > > This function builds a comma-separated list of publication names. > > It is called in 2 scenarios: > 1. to construct a pubname list to be included in some SQL (here, > parameter quote_literal=3Dtrue) > 2. to construct a pubname list to be included in some error message > (here, parameter quote_literal=3Dfalse). > > In hindsight, it looks like this function has been broken since it was > originally implemented 4 yrs ago (8f2e2bb), because it does not allow > translation of commas and quotes when the result is being used for > error messages. > > PSA a patch to fix that. > > =3D=3D=3D=3D=3D=3D > [1] https://www.postgresql.org/message-id/202604011144.jeo56tazdx6z%40alv= herre.pgsql > PSA patch v2. v2 removes translation of the comma separator, due to the discussion over at [1]. =3D=3D=3D=3D=3D=3D [1] https://www.postgresql.org/message-id/CAApHDvoFSu5zLFvx96aZ5wvL7tcB9aR2= hBPCaMPs8D_f0Z7eSw%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia --000000000000d3093406501b8c94 Content-Type: application/octet-stream; name="v2-0001-GetPublicationsStr-i18n-support-for-quotes.patch" Content-Disposition: attachment; filename="v2-0001-GetPublicationsStr-i18n-support-for-quotes.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mob5ovk10 RnJvbSBmOWE1MDM0Y2Q0ZDBmNmViOTMwOTI2ZGUwM2U0ZTY4OGMxNTBlYWMzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBTbWl0aCA8cGV0ZXIuYi5zbWl0aEBmdWppdHN1LmNv bT4KRGF0ZTogVGh1LCAyMyBBcHIgMjAyNiAxNzoxODowMyArMTAwMApTdWJqZWN0OiBbUEFUQ0gg djJdIEdldFB1YmxpY2F0aW9uc1N0ciBpMThuIHN1cHBvcnQgZm9yIHF1b3RlcwoKLS0tCiBzcmMv YmFja2VuZC9jYXRhbG9nL3BnX3N1YnNjcmlwdGlvbi5jIHwgNiArLS0tLS0KIDEgZmlsZSBjaGFu Z2VkLCAxIGluc2VydGlvbigrKSwgNSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9zcmMvYmFj a2VuZC9jYXRhbG9nL3BnX3N1YnNjcmlwdGlvbi5jIG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