Re: Get rid of translation strings that only contain punctuation - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: Get rid of translation strings that only contain punctuation
Date
Msg-id aenmpCqhKzTDOsxO@alvherre.pgsql
Whole thread
In response to Get rid of translation strings that only contain punctuation  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On 2026-Apr-22, David Rowley wrote:

> We've got a few parts of the code that translate strings that contain
> only a single punctuation character. I'm not a translator, but I
> suspect that these would be tricky to deal with as such short strings
> could be used for various different things, and if the required
> translation was to differ between requirements, then you're out of
> luck.

Yeah.

> I looked at: git grep -A 1 "msgid \", \"" and I see French is the only
> translation to do anything different with the ", " string, and only in
> psql.

Japanese also uses different punctuation characters, so I don't think we
should get rid of translating these characters.

Instead we should do what Tom says and integrate these characters into a
larger string.  I showed one example in a nearby thread from Peter Smith
[1], and I think a couple of the spots you're patching can be easily
done in the same way.

As for the one in guc.c, I think what we should do is change
config_enum_get_options() to have an API similar to GetPublicationsStr:
instead of receiving prefix, suffix and separator, we should tell that
function that we're constructing a list to be used in as an SQL value
(GetConfigOptionValues), or one to be displayed to the user
(parse_and_validate_value); and have the function add the separators and
other decoration as needed, using the same technique.  (The other prefix
"Available values: " can be added by the caller, I think, and maybe the
braces also, not sure.)

[1] https://postgr.es/m/aeniYoOwCQmtWtQW@alvherre.pgsql

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [Patch] Block ALTER TABLE RENAME COLUMN when column is used by property graph
Next
From: Yura Sokolov
Date:
Subject: Re: PoC: Add condition variable support to WaitEventSetWait()