Tag Archives: gettext

Use upstream gettext instead the glib one

Some people asked me about this, so here a fast tutorial:
Replace this in your configure.ac:

AM_GLIB_GNU_GETTEXT

with this:

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])

You can see an example in this commit: [1]

Now the theory: gettext has two different utilities: autopoint and gettextize. Here the different purposes of these programs:

  • autopoint [2] Copies the gettext infrastructure that has been omitted from version control.
  • gettextize [3] The `gettextize’ program is an interactive tool that helps the maintainer of a package internationalized through GNU `gettext’. … As a migration tool, for upgrading the GNU `gettext’ support in a package from a previous to a newer version of GNU `gettext’.

So, you should only use autopoint in your autogen.sh file. Only the maintainer should call the gettextize program.
Fortunately, autopoint is automatically called in both gnome-autogen.sh and autoreconf, so no need to change your autogen.sh file.

Note that autopoint needs the AM_GNU_GETTEXT_VERSION() macro to know the version of gettext files you want tou use, because it copies the infrastructure files belonging to this version into the package. ie, AM_GNU_GETTEXT_VERSION([0.17]) means exactly 0.17, not 0.17 and above.

Why we use glib-gettextize then? Well, as far as I know It’s mainly for historical reasons: autopoint was not added until version 0.11 of gettext. However, GNOME did not require gettext version 0.11 those days, so it would had been premature to rely on that script. That is not a problem anymore.

There is also a bug to deprecate the Glib gettext macros: [4]

[1] http://git.gnome.org/browse/giggle/diff/configure.ac?id=7eb32e8d39c382b3bd8a670198b77cbc844c60a7
[2] http://www.gnu.org/software/gettext/manual/gettext.html#autopoint-Invocation
[3] http://www.gnu.org/software/gettext/manual/gettext.html#index-gettextize-1117
[4] https://bugzilla.gnome.org/show_bug.cgi?id=624186


Flattr this