Re: [WIP] 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: [WIP] plpgsql is not translate-aware
Date: 2008-10-08 20:31:27
Message-ID: 20081008203127.GF4164@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> It seems like something like that could work. I'd be inclined to change
> the ereport() macro itself, not errmsg/errdetail/etc. The domain name
> could be passed in at ereport and then used when evaluating the
> messages.

This seems to work fine. Modules would provide their message domain by
overriding the ereport() definition to pass a different domain to
ereport_domain(), like the attached plpgsql_i18n.h.

Now, the obvious big problem I have with this patch is that I have to
pass plpgsql's locale path to bindtextdomain(), but I'm not seeing any
decent way to do that ... ideas?

Note that I didn't bother changing the elog() macros to provide a
message domain ... I'm sure that can be fixed but it's very low
priority, given that most of the time those messages do not get
translated.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Attachment Content-Type Size
plpgsql-i18n.patch text/x-diff 6.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-10-08 22:31:49 Re: [WIP] plpgsql is not translate-aware
Previous Message Tom Lane 2008-10-08 20:27:28 Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows