Re: plpgsql is not translate-aware

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: plpgsql is not translate-aware
Дата
Msg-id 20080905165205.GH4353@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: plpgsql is not translate-aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.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.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Withdraw PL/Proxy from commitfest
Следующее
От: Tom Lane
Дата:
Сообщение: Re: 8.4devel out of memory