Re: plpgsql is not translate-aware

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: plpgsql is not translate-aware
Date: 2008-09-05 16:35:08
Message-ID: 20080905163508.GG4353@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > In reviewing Volkan Yazici's (sorry for the dots) patch to improve
> > plpgsql's error messages, I noticed that we have no PO files for plpgsql
> > at all!
>
> Ugh. Yeah, we should fix that. Does it actually just work, seeing
> that plpgsql is a loadable library?

Well, it didn't, but I just tested what I posted in the followup and it
does work:

alvherre=# create function aa (internal) returns int language plpgsql as $$ begin; select 1; end; $$;
ERROR: las funciones plpgsql no pueden tener el tipo internal como argumento

The vices in the error message are not the translator's fault: missing
quotes and "plpgsql" instead of "PL/pgSQL":

alvherre=# set lc_messages to 'C';
SET
alvherre=# create function aa (internal) returns int language plpgsql as $$ begin; select 1; end; $$;
ERROR: plpgsql functions cannot take type internal

I'd even go a bit further and say that the original should not include
the language name in the string, so that (say) plpython and plperl can
use the same translation:

"%s functions cannot take type \"%s\"", "PL/pgSQL", type_name

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-05 16:37:58 Re: Withdraw PL/Proxy from commitfest
Previous Message Marko Kreen 2008-09-05 16:22:19 Re: Need more reviewers!