Re: [HACKERS] Different gettext domain needed for error context

2012-04-16 Thread Heikki Linnakangas
On 15.04.2012 00:54, Tom Lane wrote: I really think we need to change errcontext itself to pass the correct domain. If we are going to require a domain to be provided (and this does require that, for correct operation), then we need to break any code that doesn't provide it in a visible fashion.

Re: [HACKERS] Different gettext domain needed for error context

2012-04-14 Thread Tom Lane
Heikki Linnakangas writes: > 3. In the callback function, call a new function to set the domain to be > used for the errcontext() calls in that callback: > /* use the right domain to translate the errcontext() calls */ > set_errtextdomain(); > errcontext("PL/Perl anonymous cod

Re: [HACKERS] Different gettext domain needed for error context

2012-04-14 Thread Heikki Linnakangas
On 15.02.2012 20:13, Tom Lane wrote: Heikki Linnakangas writes: To fix this, we need to somehow pass the caller's text domain to errcontext(). The most straightforward way is to pass it as an extra argument. Ideally, errcontext() would be a macro that passes TEXTDOMAIN to the underlying functio

Re: [HACKERS] Different gettext domain needed for error context

2012-02-15 Thread Tom Lane
Heikki Linnakangas writes: > To fix this, we need to somehow pass the caller's text domain to > errcontext(). The most straightforward way is to pass it as an extra > argument. Ideally, errcontext() would be a macro that passes TEXTDOMAIN > to the underlying function, so that you don't need to

[HACKERS] Different gettext domain needed for error context

2012-02-15 Thread Heikki Linnakangas
I just noticed that we use the same gettext domain for all messages attached to one error. That is wrong in case of context information, where you have a stack of context lines, originating from different modules. The result is that context lines don't always get translated. For example: post