Glib: AM_GLIB_GNU_GETTEXT



Hi there,

I have been trying to understand how to configure gettext and use the glib/gi18n.h header that comes with glib. I have already read a big part of the gettext documentation [1] and tried various other sources [2,3,4,5]. About the background: I have a software that had a (very old) copy of gettext directly included in the source code (e.g. src/gettext.h src/translation.h) and I am trying to migrate it to use glib's internationalization features.

I have already upgraded the configure.ac file and currently it looks like this:

# This will initialize the internationalization
# capabilities of glib (glib/gi18n.h) and gettext
IT_PROG_INTLTOOL([0.41.0])
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])

and in autogen.sh i only call autoreconf -ivs

Now my questions. When looking at gedit source [6] then it also contains the following additional macros:

AC_SUBST([GETTEXT_PACKAGE], [gedit])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [Define to the gettext package name.])

Im not sure if they are needed in my case.

Secondly, when I look at some other configure.ac files then i find that there are other ways to configure gettext [7]:

# Define GETTEXT_PACKAGE=window-picker-applet and also replace all
# occurences of @GETTEXT_PACKAGE@ with window-picker-applet
AC_SUBST([GETTEXT_PACKAGE], [window-picker-applet])
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
ALL_LINGUAS="`cat "$srcdir/po/LINGUAS" | grep -v '^#'`"

IT_PROG_INTLTOOL([0.34])

AM_GLIB_GNU_GETTEXT

The particular difference here is that AM_GLIB_GNU_GETTEXT is being used. While it is possible to get at least some information about the AM_GNU_GETTEXT macro at [1] [3] [5] and [8] there is virtually no information about AM_GLIB_GNU_GETTEXT. For example it is not being mentioned in [4] trying to google for it only gives results about people asking why automake cannot find this macro and what they need to install and [9] also does not contain much information.

One particular difference that I have noticed, is that using AM_GLIB_GNU_GETTEXT does not generate the file ABOUT-NLS (but I could be wrong about this). Generally I am wondering if this file is still needed and or useful now days or if is just a left over from some old version of gettext. I also get an error about po/Makefile.in.in (which seems to be an automatically generated file):

    config.status: error: po/Makefile.in.in was not created by intltoolize.

And im wondering how I can get rid of this error.

I hope I have included enough information to show that I have done some research already. I think that the gnome documents of the glib gettext api at [4] could use an update and that they should contain some information about the AM_GLIB_GNU_GETTEXT macro. And I hope someone could shed some light into the problem i mentioned above.

Kind Regards
Lanoxx

[1] http://www.gnu.org/software/gettext/manual/gettext.html
[2] http://git.gnome.org/browse/gedit/tree/configure.ac
[3] http://www.gnu.org/software/gettext/FAQ.html
[4] http://developer.gnome.org/glib/2.31/glib-I18N.html
[5] http://people.gnome.org/~malcolm/i18n/makefile-changes.html
[6] http://git.gnome.org/browse/gedit/tree/configure.ac
[7] https://github.com/lanoxx/window-picker-applet/blob/master/configure.ac
[8] /usr/share/aclocal/gettext.m4
[9] /usr/share/aclocal/glib-gettext.m4


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