Re: Mark class_descr strings for translation

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Mark class_descr strings for translation
Date: 2026-07-07 12:39:02
Message-ID: bca99988-134b-42c7-836c-63914803b536@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07.07.26 13:51, Álvaro Herrera wrote:
> On 2026-Jul-03, Kyotaro Horiguchi wrote:
>
>> diff --git a/src/backend/catalog/pg_depend.c b/src/backend/catalog/pg_depend.c
>> index 9a7a401aced..0d28d34412d 100644
>> --- a/src/backend/catalog/pg_depend.c
>> +++ b/src/backend/catalog/pg_depend.c
>> @@ -810,7 +810,7 @@ dependencyLockAndCheckObject(Oid classId, Oid objectId)
>> ereport(ERROR,
>> (errcode(ERRCODE_UNDEFINED_OBJECT),
>> errmsg("referenced %s was concurrently dropped",
>> - get_object_class_descr(classId))));
>> + _(get_object_class_descr(classId)))));
>
> I agree with the patch idea in general, but I'm not sure that this
> string is really adequate. For instance, with this string we cannot
> make "referenced" and "dropped" in the right gender declension depending
> on the object type, and that will make the message look weird in some
> languages -- specifically in Spanish but I'm guessing it can be a
> problem in others as well.
> "rol referenciado fue borrado concurrentemente"
> "tabla referenciada fue borrada concurrentemente"
> and so on.
> (Most object types are feminine, but at least "role" and "operator" are
> masculine.)
>
> I propose we make this
> "referenced object of type \"%s\" was concurrently dropped"
>
> so that the declension of "referenced" and "dropped" refer to the gender
> of the word "object". We'd no longer have a problem there:
> "el objeto referenciado de tipo "tabla" fue borrado concurrentemente"
> This reads a bit odd, but we no longer have a grammatical gender problem
> there.
>
> (We could leave out the quote marks, perhaps.)

The class_descr is meant for internal messages only, for the reasons you
describe. The fact that there is now a non-internal message that uses
it is a bug and that should be fixed at that caller.

When I was working on generating the ObjectProperty tables
automatically, I was working toward getting rid of class_descr
altogether, because it's mostly not useful. (For internal error
messages, you might as well just print the actual catalog name.) I
don't think we should be working toward making this facility more
attractive now.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matheus Alcantara 2026-07-07 13:25:57 Add missing CustomPathMethods on typedefs.list
Previous Message Peter Eisentraut 2026-07-07 12:25:49 Re: Increased SECURITY RISCS from omitting some compikler options when building PG with meson; e.g. -fcf-protection=full