Re: StringInfo fixes, v19 edition. Plus a few oddities - Mailing list pgsql-hackers

From Tom Lane
Subject Re: StringInfo fixes, v19 edition. Plus a few oddities
Date
Msg-id 227279.1775956328@sss.pgh.pa.us
Whole thread Raw
In response to StringInfo fixes, v19 edition. Plus a few oddities  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> append_tuple_value_detail() contains some pretty weird translation
> strings. The code currently does:

> /* translator: This is the terminator of a conflict message */
> appendStringInfoString(buf, _("."));

> I'm not a translator, but isn't that going to be pretty hard to know
> what to do with, given that the same string could be used for anything
> else in the code and need something completely different done? That
> same function also contains a _(": ") and _(", ") which seem equally
> hard to deal with.

Yeah, this seems to me to fly in the face of our style guide's
rule about "don't construct messages out of parts".  And the
reason for the rule is precisely that stuff like this poses
insoluble problems for translators.

I think it'd be reasonable to make this helper function build
a string like
    (value, value, value)
with the punctuation being untranslated on the grounds that this
is standard SQL notation.  Then that could be plugged into a
translatable message that might hopefully represent a full sentence
with a %s for the tuple data.

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: StringInfo fixes, v19 edition. Plus a few oddities
Next
From: SATYANARAYANA NARLAPURAM
Date:
Subject: Bug: trailing comma syntax error in postgres_fdw fetch_attstats()