| From: | elodie <beifu23(at)foxmail(dot)com> |
|---|---|
| To: | pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
| Subject: | Chinese translations not applied correctly on PostgreSQL 18 Windows |
| Date: | 2026-04-23 02:03:32 |
| Message-ID: | tencent_B018750E6CA100B2139B1DBE02571A2E8009@qq.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
Hi there,
Here I'd like to report an issue encountered during my use of PG18.
Description:
Chinese translations exist in the .mo file but are not being used at runtime for error messages on PostgreSQL 18 Windows.
Environment:
- PostgreSQL version: 18.0
- OS: Windows 10 x64 (Build 17763)
- Installation: EnterpriseDB installer (postgresql-18.0-1-windows-x64.exe)
- Locale: zh_CN (Chinese Simplified)
- Database encoding: UTF8
Steps to reproduce:
1. Install PostgreSQL 18 on Windows
2. Set environment: LANG=zh_CN, chcp 936
3. Run psql and execute: INSERT INTO tb (c) VALUES ('a\O\0');
Expected output (based on .mo file translations):
错误: 无效的 "UTF8" 编码的字节顺序: 0x00
Actual output:
WARNING: nonstandard use of escape in a string literal
第1行INSERT INTO tb (c) VALUES ('a\O\0');
^
提示: Use the escape string syntax for escapes, e.g., E'\r\n'.
ERROR: invalid byte sequence for encoding "UTF8": 0x00
Observations:
- Some parts ARE translated: "第1行" (line 1), "提示" (HINT)
- Main messages are NOT translated: "WARNING", "ERROR", error text
- The .mo file at C:\Program Files\PostgreSQL\18\share\locale\zh_CN\LC_MESSAGES\postgres-18.mo contains 5214 translations including:
- "ERROR" → "错误"
- "WARNING" → "警告"
- "nonstandard use of escape in a string literal" → "字符串常量中以非标准的方法使用转义字符"
- "invalid byte sequence for encoding \"%s\": %s" → "无效的 \"%s\" 编码的字节顺序: %s"
Translation file verified:
The translations exist in the .mo file but are not being applied at runtime.
Possible cause:
This appears to be a bug in PostgreSQL 18's gettext internationalization on Windows, where some message types are not being correctly localized.
---
Please let me know if you need any additional information.
Thanks and Best Regards!
Elodie Fu
elodie
beifu23(at)foxmail(dot)com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | surya poondla | 2026-04-23 04:17:29 | Re: BUG #19382: Server crash at __nss_database_lookup |
| Previous Message | Richard Guo | 2026-04-23 00:55:10 | Re: BUG #19418: SQL/JSON JSON_VALUE() does not conform to ISO/IEC 9075-2:2023(E) 6.34 <JSON value constructor> |