Re: locale data in different prefix
- From: James Henstridge <james daa com au>
- To: Gediminas Paulauskas <menesis delfi lt>
- Cc: <gnome-i18n gnome org>, <gnome-devel-list gnome org>, <gal-hackers ximian com>
- Subject: Re: locale data in different prefix
- Date: Mon, 7 May 2001 00:46:56 +0800 (WST)
On 6 May 2001, Gediminas Paulauskas wrote:
> Which library? Yes, I can only confirm, that gnome-libs, and bonobo
> work. But both of them do it in bonobo_init or
> gnome_init_with_popt_table, and application must call these
> initialization functions.
>
> However, gal does not gave gal_init function. Should it call
> bindtextdomain before any use of dgettext? Or, it would be a solution,
> can a library have main() function? And where to put it (useing gal as
> example)?
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.
James.
--
Email: james daa com au
WWW: http://www.daa.com.au/~james/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]