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:52:05 |
Message-ID: | 20080905165205.GH4353@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:
> > Actually this is wrong -- since the library is going to run with
> > "postgres" text domain, we need to add the files to the backend's
> > nls.mk:
>
> Can't we give it its own text domain? It seems fundamentally wrong
> for a plug-in language to require core support for its messages.
> (Now that I think about it, that may have been the reason we don't have
> localization for it already.) I suppose this must be possible,
> since e.g. glibc manages to have its own messages separate from
> whatever app it's linked with.
I'm not sure how this'd work. I think this would require plpgsql using
dgettext (passing a domain) instead of plain gettext(), but since it
uses ereport() just like the backend, I don't see a good way to make
that work.
Maybe another idea would be to call textdomain() just before calling
anything that would raise an error, and reset it on exit. But since
backend errors can happen at any time too, this doesn't seem possible.
Not sure how glibc does it. Maybe they just use dgettext().
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-09-05 17:02:17 | Re: 8.4devel out of memory |
Previous Message | Tom Lane | 2008-09-05 16:38:20 | Re: plpgsql is not translate-aware |