Re: internationalization

Mathieu Lacage wrote:
> hi all,
> I would like to know how libraries succeed at making internationalization work.
> As I see it, when a library has a string to internationalise, the _( macro
> will catually be a call to gettext which is going to fetch the message from
> the domain currently set. If I have loaded this library from a program which
> has set another domain, the string is fetched from the program's domain and
> not from the library doamin.
> The only solution I see here is to have each library function call
> bindtextdomain and textdoamin at the begening of each function call but
> this is obviously not the case in production code.
> So, my question is: how does it work ?

The "_" macro is usually expanded to dgettext (PACKAGE, String) in libraries.
So the domain is always passed in explicitly.
(see libgnome/gnome-i18n.h and gnome-i18nP.h, and gtk/gtkintl.h)


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