PL/Perl translation, croak

Started by Peter Eisentrautalmost 17 years ago3 messages
#1Peter Eisentraut
peter_e@gmx.net

plperl's nls.mk contains

GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext
write_stderr croak Perl_croak

As far as I can tell, croak() and Perl_croak() are provided by the Perl
library. So it is quite unclear to me how we expect their argument
strings to be translated using our message catalogs. Is this unfinished
business or is there some mechanism here that I'm not seeing?

#2Alvaro Herrera
alvherre@commandprompt.com
In reply to: Peter Eisentraut (#1)
Re: PL/Perl translation, croak

Peter Eisentraut wrote:

plperl's nls.mk contains

GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext
write_stderr croak Perl_croak

As far as I can tell, croak() and Perl_croak() are provided by the Perl
library. So it is quite unclear to me how we expect their argument
strings to be translated using our message catalogs. Is this unfinished
business or is there some mechanism here that I'm not seeing?

IIRC I just added them because we have a couple of error messages that
are output with Perl_croak and one with croak. Does it fail to work? I
don't remember if I actually tested it.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: PL/Perl translation, croak

Alvaro Herrera <alvherre@commandprompt.com> writes:

Peter Eisentraut wrote:

plperl's nls.mk contains

GETTEXT_TRIGGERS:= _ errmsg errdetail errdetail_log errhint errcontext
write_stderr croak Perl_croak

As far as I can tell, croak() and Perl_croak() are provided by the Perl
library. So it is quite unclear to me how we expect their argument
strings to be translated using our message catalogs. Is this unfinished
business or is there some mechanism here that I'm not seeing?

IIRC I just added them because we have a couple of error messages that
are output with Perl_croak and one with croak. Does it fail to work? I
don't remember if I actually tested it.

ISTM it would only work if the message was fed through our gettext
before being passed to croak(). So you'd need to write croak(_("msg"))
and marking croak itself as a gettext trigger is wrong.

regards, tom lane