Re: [Gal-hackers] Re: locale data in different prefix



On 07 May 2001 00:46:56 +0800, James Henstridge wrote:
> For cases like that, you can use a gettext wrapper similar to what glib
> does in the HEAD branch.  That is, defining the _() macro to call a
> function something like this:
> gchar *
> _gal_gettext (const gchar *str)
> {
>     static gboolean initialised = FALSE;
> 
>     if (!initialised) {
>         bindtextdomain(PACKAGE, LOCALEDIR);
>         initialised = TRUE;
>     }
>     return dgettext(PACKAGE, str);
> }
> 
> This will delay the bindtextdomain() call til the first gettext usage in
> the library, which gets rid of the need to call it in a library
> initialisation function.

OK. I added it to GAL, it works. May I commit this (this function would
be in a new file, so Makefiles need fixing and it won't show up in a
diff)?
 
--
Gediminas Paulauskas
Kaunas, Lithuania




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]