Re: [WIP] plpgsql is not translate-aware - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [WIP] plpgsql is not translate-aware
Date
Msg-id 48EE0CA8.4000301@gmx.net
Whole thread Raw
In response to Re: [WIP] plpgsql is not translate-aware  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: [WIP] plpgsql is not translate-aware
List pgsql-hackers
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
>> Tom Lane wrote:
> 
>>> No, you could have TEXTDOMAIN be defined as NULL by default, and let
>>> modules redefine it as "foo".
>> Doh, right.
> 
> So this'd seem to be the version ready to be applied (plus the needed
> nls.mk files).

Perhaps repeated code like the following should be refactored to a 
common function offered by the backend?

>  > diff -c -p -r1.40 pl_handler.c
> *** src/pl/plpgsql/src/pl_handler.c    29 Aug 2008 13:02:33 -0000    1.40
> --- src/pl/plpgsql/src/pl_handler.c    9 Oct 2008 00:51:22 -0000
> *************** _PG_init(void)
> *** 42,47 ****
> --- 42,57 ----
>       if (inited)
>           return;
>   
> + #ifdef ENABLE_NLS
> +     if (my_exec_path[0] != '\0')
> +     {
> +         char    locale_path[MAXPGPATH];
> + 
> +         get_locale_path(my_exec_path, locale_path);
> +         bindtextdomain(TEXTDOMAIN, locale_path);
> +     }
> + #endif
> + 
>       plpgsql_HashTableInit();
>       RegisterXactCallback(plpgsql_xact_cb, NULL);
>       RegisterSubXactCallback(plpgsql_subxact_cb, NULL);




pgsql-hackers by date:

Previous
From: "Jim Cox"
Date:
Subject: TODO item: adding VERBOSE option to CLUSTER
Next
From: Andrew Sullivan
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches