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 1w9yds-001wSN-0X for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 05:06:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9ydq-00EXSC-0U for pgsql-hackers@arkaria.postgresql.org; Tue, 07 Apr 2026 05:06:22 +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 1w9ydp-00EXS4-2Q for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 05:06:22 +0000 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w9ydn-00000001293-1vBh for pgsql-hackers@lists.postgresql.org; Tue, 07 Apr 2026 05:06:21 +0000 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-505a1789a27so24692741cf.3 for ; Mon, 06 Apr 2026 22:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1775538378; cv=none; d=google.com; s=arc-20240605; b=Xzg09fG2QXbNAKpTCsGgELOVClxuuKJyWIMeDiFJR6QamK05Xf9W9VWbWNMAXLUMdI 6ueYsdQcHo1LTHkgSR4zvuzqOYuyG1XRTgQAAU2wAKRDxt34kAQ511nO/W+xTEgN+0ES 0vFSajTapz2m1Umg1rFpLkSzs3l117Jc9+PTDXaokD3qyYrOPVfYReAGiW6odA2W60+x RaxHQ7owlJQlaFxgrZG0VvP4ABaI/lsFe1q/ZG0wV1mQk6dfBJ7ClkHhaCvp6UqygZYE 78TobLrYti0ulfNj/bbjCTELNJh/HbVS2hhJXFazd9s5buC8fnY0hRt8QE8RHvpQK10A +H4w== 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=QxlLlyfqNIgq1X6S3Vl6Wa7HJ2eeDcNxW9G0BpZq+DM=; fh=tvS4T4+oR2J2hxK5aNJGfORVVBBvqUJPnvm76ijROZw=; b=eX0D5jVBTox3KZYV6bl2HdTxyA0z0do9NvK6NXtHsv/O/DGCmSeKMmEkWAvhtTakro COFNN9ajfWDt/OFumNlLZtmmnuG53U6fD1WOKd0PHmAhwwslMr3ySqWkZGU2Qmshd4r3 HQnxPkK/oQA+DCjAbLKty8EEizj6cXpmshvPTpl6ekdinEyc4ipc9K+7cOvX/yDem8nF zJ7dV91GPEKtlCNMSmYIEcSlLlQM5L5gOY7lrIh2l5AbyhJ4z0WJwaMcQNL2Lg/WHQaW rY6WHFuv0lwTTpAvoUS2K7DXrOQ/SzT66zdODfZGEotJ2cZ4PjI5bbz7u4PDHU3a3KBk V5Tw==; 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=1775538378; x=1776143178; 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=QxlLlyfqNIgq1X6S3Vl6Wa7HJ2eeDcNxW9G0BpZq+DM=; b=on7AbBk6vRRZKi4QXM7ZWJF20d5dQ6M+2sqQFBDDTPh7/HkRVhymS9r+jaXZtz2AiE AZ4DpQDPyuOlDMs/DhIj6aKc/4cNst2k8N0TusaXfxJX53FCaKte81euOfIdP8Y0gnBy QITYdlNYnfirOELcUQmu7hIXOrxOHkbRYXWbSxmA2/9b7Ftod6tGyQ1QmB1Og6iv+W8j 67PzziQutmKZ949YpLBaXTj0GlW15YEwLHyA63xS0hHXWRscM+/wng5tiEN9f3xLb5SR yWLeo5REJAe/nOix7ZvGTP2FxDFBQwLbvvXqVZfKMvtGa3VJSRJT7Tssojm+NaMD7rrq TZkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775538378; x=1776143178; 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=QxlLlyfqNIgq1X6S3Vl6Wa7HJ2eeDcNxW9G0BpZq+DM=; b=aKfsc0ZDlQJokPNRHrbuqj7w/1ujIU8L2+8rlIMkcDNE2g0TzGzFg9j42PEd0heY7e IGo8aGpAd6zNtrzaySIorDbyo7qrJRWeKO9VO/sZhYSlv/3GHklMZBEUAQQQP/majxUq 4Ix4W1jbiXcOuJosN/JmPBtWo8+sqpcMR6ij4B4/eHyP12auUpmQK+Rk/6FXJsqSnOUf fskpE+x3MNzpFVOnhPZ9CbzmokPPMJS7DfMNFp5JrOvlVWNbSHGeOWDBxBVloODvSuuV PwoqGPk8iACWGOpBgfUJxm52nq8KuhP9RYga9aTtmwNIiaylIAYyMuiiyA5hrq8dz3Zb jwTQ== X-Gm-Message-State: AOJu0YzLcRuOc2EVr5bS2QnDU4fITb8Z1px+WEsfa2aI8ikUb4Ci83qZ vPFTXbmvbPZBmx/KhBV0ClHQi/BJ9RIL8SJ2vacWZ/xmy7U02oYBGTrVvfXuYbhsZigsxoVFbl1 VwtIT7vVwpKqegmbXePIrOZZPIDCjjcgYGUEb X-Gm-Gg: AeBDiev6I+1fmxe9AsNKCzCcL7U54M5H0OLqQwqIUTmrY+NSD8ppsuGdFhFD3JnsAmf JIG1vZ6fQ6bgbiZ+tG1WZu4WEginAmG9beNPxuX7dc3iGfey3HAi9pZE+MswK/EPh1xRvJGd7li L2cnEDTnwz92OF+gsTW+DLG8DbnZWDHGVUMl4w1qZRZIIvgvL1rvBeW61HcS+o1NzvX515wRTR6 tEk2zm/KGIr0PA8EHvePmwDk3i4q6fx9SpWg0x1SGUrgQv0jNKObUE8KjDSBVDO9zjEU4TV402Q ohTT2q4= X-Received: by 2002:ac8:7d8b:0:b0:50b:4755:94b9 with SMTP id d75a77b69052e-50d62b6fc98mr237432951cf.56.1775538377507; Mon, 06 Apr 2026 22:06:17 -0700 (PDT) MIME-Version: 1.0 References: <202604011144.jeo56tazdx6z@alvherre.pgsql> In-Reply-To: <202604011144.jeo56tazdx6z@alvherre.pgsql> From: Peter Smith Date: Tue, 7 Apr 2026 15:05:51 +1000 X-Gm-Features: AQROBzBADSK_OFwJ84MG9f1Z_1RN_VAsHCiNUdUwDpiYxmAjD-prgV7ftZrqpaU 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="00000000000047366a064ed7beef" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000047366a064ed7beef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 translations > 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 : co= desetnya 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%40alvhe= rre.pgsql Kind Regards, Peter Smith. Fujitsu Australia --00000000000047366a064ed7beef Content-Type: application/octet-stream; name="v1-0001-GetPublicationsStr-i18n-support.patch" Content-Disposition: attachment; filename="v1-0001-GetPublicationsStr-i18n-support.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_mno5ne2m0 RnJvbSBjZDA5YWU3ZTRjMThiZmNiMWI2NTIyZWMxYWExNmNmYTNiNWY1MDJlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQZXRlciBTbWl0aCA8cGV0ZXIuYi5zbWl0aEBmdWppdHN1LmNv bT4KRGF0ZTogVHVlLCA3IEFwciAyMDI2IDE0OjQ1OjExICsxMDAwClN1YmplY3Q6IFtQQVRDSCB2 MV0gR2V0UHVibGljYXRpb25zU3RyIGkxOG4gc3VwcG9ydAoKLS0tCiBzcmMvYmFja2VuZC9jYXRh bG9nL3BnX3N1YnNjcmlwdGlvbi5jIHwgMTkgKysrKysrKysrKystLS0tLS0tLQogMSBmaWxlIGNo YW5nZWQsIDExIGluc2VydGlvbnMoKyksIDggZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvc3Jj L2JhY2tlbmQvY2F0YWxvZy9wZ19zdWJzY3JpcHRpb24uYyBiL3NyYy9iYWNrZW5kL2NhdGFsb2cv cGdfc3Vic2NyaXB0aW9uLmMKaW5kZXggNWE3MzM1ODU0OTAuLjhiMzFjNDg3ZGJhIDEwMDY0NAot LS0gYS9zcmMvYmFja2VuZC9jYXRhbG9nL3BnX3N1Yn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