Re: locale data in different prefix



On 06 May 2001 21:30:34 +0800, James Henstridge wrote:
> > The problem is, that there is no way for library to specify domain
> > search path. In an app, it is done by:
> >
> > bindtextdomain (PACKAGE, LOCALEDIR); /* this associates domain (mo file) with */
> >                                      /* directory where it is installed */
> > textdomain (PACKAGE);                /* selects default translation domain, */
> >                                      /* used for gettext() calls */
> >
> > in library, gettext () is not used, because default domain always
> > belongs to caller app. But gettext does not know, where to search for
> > library's domain files!
> 
> What is the problem?  The library calls bindtextdomain() for its
> translation domain, with the localedir for the prefix under which it was
> installed.  To perform translations, it uses the dgettext(DOMAIN, STRING)
> function instead of straight gettext().  This should allow the library to
> find its translations and not interfere with the app's.

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)?

--
Gediminas Paulauskas
Kaunas, Lithuania




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