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 1vSh7D-003mxr-1o for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2025 19:41:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSh7C-001QMM-0f for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Dec 2025 19:41:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSh7B-001QME-30 for pgsql-hackers@lists.postgresql.org; Mon, 08 Dec 2025 19:41:46 +0000 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vSh79-003oA2-2H for pgsql-hackers@lists.postgresql.org; Mon, 08 Dec 2025 19:41:45 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-787e7aa1631so65637167b3.1 for ; Mon, 08 Dec 2025 11:41:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765222903; x=1765827703; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=RrkdmcDlg7hE6jm7GQg3q+ErYI5Ph8qrYcQjBYMwe4g=; b=gjYediaz0Lx7zxdfMfPbtokS8+QAZp7T42peMcrpDx9MApUhlghtjHZvrN8FTChZWx 2EFqnqTL0PvmxqtB7CdF4iDLtuVEmyjax1ct5pu25kzvMhxnvUNpJk0M0w/urQ4S2H/X bjxs2kXV9nXFr73mRH+1E32FdQ5elekUkn2fCYgx74j3snFlwmK4yvk8dmQlTrinW+Tp h7jQ7DuvS+h09cM3wgDEYYTcSOm0HRynYjVwubH5p9c+Jfcy5PqSRgDcIPR+WqNWXnUg vxf+YsAHI9m5j/Jwl8yv9SrjcrzBIQ4w0gmEomjqMh3q5fXKd0VuGPUQkbIHpfvxISwD 92mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765222903; x=1765827703; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RrkdmcDlg7hE6jm7GQg3q+ErYI5Ph8qrYcQjBYMwe4g=; b=HSPCFEQTNiGCs+OLJGb5eVD6/DFvgBCA2/8dqiW0iqhLYseNB0ab/DVUo7ZBHrcTsX QZZ8VYUMNrtaM5rnfxXib+744GTaWTyHkvjaTEIPvEcoHnCfT6zBSywgUxT019KMhnP8 fvwF0snLhT/KxCl7EyHUgwfz+B6hHY5BCnfTNbhOl2rt1nyXXQN5/sFssJCP4CCFMVEf e5VAPZ8HrkQnfmR3o1vW947rq84OF4dTFDHzkZ3lOugSn7DLQsY8ta35zu6IDuRxNasO 3HlUJqvtWY5k04MKWCR2gLsRw+21+DtTK5/pN4RL6qAs1oqSFUufZMHZD7O8xDXEAcOF Kiog== X-Gm-Message-State: AOJu0Yzre6RyCKI4cj7njeERNRvseV3n93U5dEtK8SyAkZYaK8O5CvpX o4BtMMHxpePGQdEu2R0SEpTSuklBpaVNEOlHpF9dmViBKBCIe1vGpGz9/j/Q3rfIJtg= X-Gm-Gg: ASbGncsBnvDMKI+pkxyr4ERhTd1/GKswYlPLIo/iQ8O48iPi5jsnsxCaKih372bHtaB cYBNjlKDSEfYDfYUf6xen0K9lYqhNCgLW4orwE5Ko+OSSyo8jRoQKHavEHfE/qD+w8cIL6b9f4Q prhf8UbVjO07vdTXlGzR98RwoZsqAqxk+QIa5C9yW9ce71kyDf6quRmR28wBmYBRMu7w5in4Nwt L4ZlJt3x4BpZ7yxtzZS8igZEbjyrZf4Nws578yPlyQQtnmuKRn6KRv4gp0mHJsyEaI4DhCK1VWz a83W1JpX8cA1+TFSFPcy4WI7/HQz9uLlRHQXreQT4AwFVWipp84wIakxxfdNnq9cHwYDHi2/zYk 1MVT4RW2MPEmnTfdLwBL8ZNK78a6qOEFbsFdjfC00QNs9yrWW2zwW0lJhZAN7NbEMCkgJlO+7aQ IyAnGuWYRpSwzBzo6Vt5ToQa2QuTurONLLiE8didg1pCbXwTlk/+bOTQmeBRadX16NQFTSTo+9n qY= X-Google-Smtp-Source: AGHT+IHz4CTfzBv8OuO/0SFwPBNHCTmTzzEuxPkqrQ4MAxQBQTMAQD5jhwTImRHCoICX8TY24hgrFQ== X-Received: by 2002:a05:690e:138a:b0:63e:34ed:a137 with SMTP id 956f58d0204a3-64464b2bdf7mr512976d50.27.1765222902905; Mon, 08 Dec 2025 11:41:42 -0800 (PST) Received: from ?IPV6:2600:1700:8952:80:21ee:8317:4b27:e895? ([2600:1700:8952:80:21ee:8317:4b27:e895]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78c1b77942bsm50913017b3.27.2025.12.08.11.41.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Dec 2025 11:41:42 -0800 (PST) Message-ID: <3879e664-a29e-4b9b-9c83-1ffdc618d52a@gmail.com> Date: Mon, 8 Dec 2025 13:41:45 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Let's add a test for NLS translation of PRI* macros To: pgsql-hackers@lists.postgresql.org References: <3098752.1765221796@sss.pgh.pa.us> Content-Language: en-US From: Bryan Green In-Reply-To: <3098752.1765221796@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/8/2025 1:23 PM, Tom Lane wrote: > This was discussed a few weeks ago in [1], but I'm starting a > new thread so as not to confuse things with the latest patches in > that thread. The issue is that it seems like it'd be a good idea to > have specific regression testing of whether translation of the > PRI* macros works properly, since that is an aspect > of gettext() behavior that didn't use to work everywhere. > > I don't know whether the attached will pass on Windows: we might > not be able to assume that "es_ES" is the right LC_MESSAGES > setting to use. But it works for me on Linux. > > regards, tom lane > > [1] https://www.postgresql.org/message-id/flat/20250331.152829.1921392690375275165.horikyota.ntt%40gmail.com > gettext() will be fine with that if you are using < 0.20. After that version it expects you to send it the windows locale, not the IsoLocalName() converted one-- it will fail to find "es-ES" (by enumerating through ~259 window locales) and use a fallback to translate messages. Since gettext() will not cache the "not found" locale, the expensive enumeration call will happen everytime [1]. I am in the middle of writing some patches to take care of that problem and a couple of others involving that area of the code and gettext(). [1] https://savannah.gnu.org/bugs/?67781 -- Bryan Green EDB: https://www.enterprisedb.com