After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 373745 - Do not use AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR) and use gettext instead
Do not use AM_GLIB_DEFINE_LOCALEDIR(GTK_LOCALEDIR) and use gettext instead
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.1.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 763587
 
 
Reported: 2006-11-11 10:08 UTC by Loïc Minier
Modified: 2016-05-16 19:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use upstream gettext (26.12 KB, patch)
2016-03-14 02:28 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Use upstream gettext.v2 (26.18 KB, patch)
2016-04-24 19:22 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
Use upstream gettext.v3 (26.17 KB, patch)
2016-05-16 18:02 UTC, Javier Jardón (IRC: jjardon)
accepted-commit_now Details | Review
Use upstream gettext.v4 (26.18 KB, patch)
2016-05-16 19:48 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description Loïc Minier 2006-11-11 10:08:30 UTC
Hi,

Gtk's configure.in relies on a glib-gettext macro to define its localedir, but this macro is borken by design and breaks badly with autoconf 2.60.

See bug 343825 for the details.

Autoconf's upstream recommends a construct such as the following in your Makefile.am files:
AM_CPPFLAGS = -DGTK_LOCALEDIR=\"$(datadir)/locale\" (or some other value)

Please note that AM_GLIB_DEFINE_LOCALEDIR will expand to ${datadir}/locale except on Solaris where it expands to ${libdir}/locale.

Bye,
Comment 1 Javier Jardón (IRC: jjardon) 2010-05-20 21:13:19 UTC
Hello Loïc,

GTK+ requires autoconf 2.62 since GTK+ 2.20.
I can't confirm this bug here, can you?

Maybe you can provide a patch to not use AM_GLIB_DEFINE_LOCALEDIR?
Comment 2 Loïc Minier 2010-05-22 15:46:47 UTC
As noted in bug #343825, the AM_GLIB_DEFINE_LOCALEDIR macro was fixed for newer autoconfs.  It still goes against autoconf's recommendation to use such a macro.  The proper fix would be to move to gettext, but this is not a small task and I'm afraid I don't have the time to develop such a patch.

Feel free to close this bug if you prefer not to keep the request/suggestion open.

Thanks,
Comment 3 Javier Jardón (IRC: jjardon) 2016-03-14 02:28:52 UTC
Created attachment 323834 [details] [review]
Use upstream gettext
Comment 4 Matthias Clasen 2016-03-14 03:27:42 UTC
Review of attachment 323834 [details] [review]:

::: po-properties/Makevars
@@ +9,3 @@
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8

I'm pretty sure we need something else here. The current code has:

XGETTEXT_KEYWORDS = --keyword --keyword=P_

@@ +19,3 @@
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.

This should be something like:

GTK+ Team and others. See AUTHORS

@@ +26,3 @@
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =

'no' here

::: po/Makevars
@@ +9,3 @@
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --from-code=UTF-8

XGETTEXT_KEYWORDS= --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3

@@ +19,3 @@
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.

Should be:

GTK+ team and others. See AUTHORS

@@ +26,3 @@
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =

Should be: no

@@ +52,3 @@
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no

Should be: yes
Comment 5 Matthias Clasen 2016-03-14 03:28:40 UTC
Looks like a nice cleanup, but lets hold this until 3.21 opens, at this point.
Comment 6 Javier Jardón (IRC: jjardon) 2016-04-24 19:22:30 UTC
Created attachment 326641 [details] [review]
Use upstream gettext.v2

Updated patch against current master
Comment 7 Matthias Clasen 2016-04-29 12:43:27 UTC
Review of attachment 326641 [details] [review]:

::: po-properties/Makevars
@@ +2,3 @@
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)

I would just hardcode gtk30-properties here, $(PACKAGE) is certainly not right

@@ +9,3 @@
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=P_ --from-code=UTF-8

--keyword=_ here doesn't look right. If you look at the Makefile.in.in you removed, it should be --keyword

::: po/Makevars
@@ +2,3 @@
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)

I would just put gtk30 here, I don't think $(PACKAGE) is right
Comment 8 Javier Jardón (IRC: jjardon) 2016-05-16 18:02:44 UTC
Created attachment 328001 [details] [review]
Use upstream gettext.v3
Comment 9 Matthias Clasen 2016-05-16 18:12:42 UTC
Review of attachment 328001 [details] [review]:

With this one fix, looks good to me now

::: po/Makevars
@@ +3,3 @@
+# Usually the message domain is the same as the package name.
+DOMAIN = gtk3
+

This needs to be gtk30, to keep the current domain.
Comment 10 Javier Jardón (IRC: jjardon) 2016-05-16 19:48:41 UTC
Created attachment 328011 [details] [review]
Use upstream gettext.v4
Comment 11 Javier Jardón (IRC: jjardon) 2016-05-16 19:50:10 UTC
Review of attachment 328011 [details] [review]:

commit 101da71ee30e53fe0338bc67605a98527277ee56
Comment 12 Javier Jardón (IRC: jjardon) 2016-05-16 19:50:34 UTC
Thanks for the reviews!