Re: Redundant/mis-use of _(x) gettext macro?

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Redundant/mis-use of _(x) gettext macro?
Date: 2026-04-24 12:14:30
Message-ID: aeteISM1k7ZtM4Cs@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Apr-24, Peter Smith wrote:

> OK. Including the comma within a larger translated string seems like a
> better idea.
>
> Since you now have the list `length`, I wondered why not simplify
> further to use list_nth indexing? Then you can remove
> `foreach_current_index` and `lc`.

WFM.

> Also, why did you choose to implement `last` versus `first` logic?
> e.g. How about this?

> {
> if (first)
> appendStringInfo(dest, _("\"%s\""), pubname);
> else
> appendStringInfo(dest, _(", \"%s\""), pubname);
> }

I don't know, it just seemed more natural. The whole ", foo" style
simply feels weird to me. It seems a matter of choice only though, so
if you feel strongly about this, I'm not opposed.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"Hay dos momentos en la vida de un hombre en los que no debería
especular: cuando puede permitírselo y cuando no puede" (Mark Twain)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2026-04-24 12:38:07 Re: Property graph: fix error handling when dropping non-existent label property
Previous Message Ashutosh Bapat 2026-04-24 12:07:56 Re: Fix DROP PROPERTY GRAPH "unsupported object class" error