| From: | Peter Smith <smithpb2250(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org> |
| Subject: | Re: Get rid of translation strings that only contain punctuation |
| Date: | 2026-04-22 02:20:08 |
| Message-ID: | CAHut+PsonSOOmpWa+p5pWWf_wks8V7=w9OhHeTP1jA0=oukCjA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, Apr 22, 2026 at 11:31 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Peter Smith <smithpb2250(at)gmail(dot)com> writes:
> > On Wed, Apr 22, 2026 at 10:30 AM David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
> >> Should we get rid of these?
>
> > This question overlaps with another thread of mine [1].
> > There, I was told that a punctuation double-quote (") *should* be translated.
>
> It should be, but it *has to be translated as part of a coherent
> message*. As the examples in [1] show, several languages translate
> opening and closing double-quotes differently. So if you write _("\"")
> there is zero hope of that being usefully translatable.
>
> This all goes back to the translatability guideline about not
> constructing messages out of parts [2]. If you've got a single
> punctuation mark as a separate string, you are violating both the
> letter and the spirit of that guideline, and that has consequences
> for translatability.
>
> regards, tom lane
>
> [1] https://www.postgresql.org/message-id/CAHut%2BPui7RaQ8OfJEVn2ry-ykjnGc%2B3ujsFmcHDFw9FsXw_tRw%40mail.gmail.com
> [2] https://www.postgresql.org/docs/devel/nls-programmer.html#NLS-GUIDELINES
To my knowledge, we aren't violating that guideline because our
substituted parts aren't words of a sentence; they are quoted names in
a list
e.g.
Case#1: publication "XXX" has a problem
Case#2: the following publications have a problem: "XXX", "YYY", "ZZZ"
~~~
Case#1 is easy. "publication \"%s\" has a problem"
The quotes are part of the message, so they get translated as normal.
Case#2 is more fiddly. "the following publications have a problem: %s"
The substituted quoted-name list is constructed at runtime, but still,
we require those quotes to be translated so that quoted-names in cases
#1 and #2 look the same.
======
Kind Regards,
Peter Smith.
Fujitsu Australia
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2026-04-22 02:32:48 | Re: Get rid of translation strings that only contain punctuation |
| Previous Message | jian he | 2026-04-22 02:11:46 | Re: on_error table, saving error info to a table |