Re: i18n questions



Nuno> I think every file that needs to be translated needs to include
Nuno> either "libgnome/gnome-i18n.h" or "libgnome/gnome-i18nP.h", the
Nuno> first being for programs and the second for libraries. Also they
Nuno> need to include <config.h> before one of these files to define
Nuno> ENABLE_NLS.

This is mostly true.  *Every* .c file should include <config.h> as the
first thing.  This is just a good habit to get into.

Generally the libraries need gnome-i18nP.h and not libgnome.h.  I
added libgnomeP.h, so you can use that now instead of libgnome.h, for
convenience.

How you decide depends on the translation domain which you want _() to
use by default.  Generally the Gnome libraries have their own
translation domain, so _() expands to dgettext().  However, some
library code might actually take strings that must be translated in
the application's translation domain.  In this case you must use
gnome-i18n.h to get _() mapped to gettext().  (There is one such case
in Gnome.)

Nuno>  - Which files need to include <config.h> besides the ones
Nuno> including one of the i18n files?

As Miguel says, all of them.

Nuno>  - None of the files in libgnomeui should include
Nuno> "libgnome/libgnome.h" because it includes gnome-i18n.h(not
Nuno> gnome-i18nP.h).

Correct.  Now including libgnomeP.h is ok, though.

I went through all of gnome-libs and made the appropriate fixes.  Let
me know if you have any problems.

Tom



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