Re: Chinese translations not applied correctly on PostgreSQL 18 Windows - Mailing list pgsql-bugs

From elodie
Subject Re: Chinese translations not applied correctly on PostgreSQL 18 Windows
Date
Msg-id tencent_6BA137F0A6610F6857E7CBB609C024D1D705@qq.com
Whole thread
In response to Re: Chinese translations not applied correctly on PostgreSQL 18 Windows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Thanks Tom! Setting lc_messages = 'zh_CN' fixed the issue. The Chinese translations are now working well.

Thanks and Best Regards!

Elodie Fu



Original

From: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2026-04-24 05:28
To: elodie <beifu23@foxmail.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: Chinese translations not applied correctly on PostgreSQL 18 Windows

"elodie" <beifu23@foxmail.com> writes:
> 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');

Setting that environment variable isn't sufficient.  It'll cause
psql to translate messages that it generates locally, but to get
translated messages from the server, you need to set the server's
lc_messages parameter.  I speak no Chinese, so I can't really
read your example, but here's an example using French:

$ LANG=fr_FR.utf8 psql
psql (19devel)
Saisissez « help » pour l'aide.

postgres=# select 1/0;
ERROR:  division by zero
postgres=# set lc_messages = 'fr_FR';
SET
postgres=# select 1/0;
ERREUR:  division par zéro

You can use any of the various ways of setting a server parameter
to install that setting on a more permanent basis.

regards, tom lane

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: to_date()/to_timestamp() silently accept month=0 and day=0
Next
From: "elodie"
Date:
Subject: Typo in Chinese translation: "转移" should be "转义"