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 789010 - [Patch] Migrate from intltool to gettext
[Patch] Migrate from intltool to gettext
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2017-10-15 12:00 UTC by Niels De Graef
Modified: 2018-04-15 03:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[Patch] Migrate from intltool to gettext (14.41 KB, patch)
2017-10-15 12:00 UTC, Niels De Graef
committed Details | Review
Restore the versioning of the installed *.mo files (1.55 KB, patch)
2017-11-13 14:09 UTC, Debarshi Ray
none Details | Review
Restore the versioning of the installed *.mo files (2.34 KB, patch)
2017-11-14 12:29 UTC, Debarshi Ray
none Details | Review
Restore the versioning of the installed *.mo files (2.87 KB, patch)
2017-11-14 14:59 UTC, Debarshi Ray
committed Details | Review
Restore the versioning of the installed *.mo files (v2) (913 bytes, patch)
2017-11-14 15:52 UTC, Debarshi Ray
committed Details | Review

Description Niels De Graef 2017-10-15 12:00:15 UTC
Created attachment 361616 [details] [review]
[Patch] Migrate from intltool to gettext

Migrate from intltool to GNU gettext.


For context: see https://wiki.gnome.org/MigratingFromIntltoolToGettext
Comment 1 Øyvind Kolås (pippin) 2017-10-15 15:19:25 UTC
Thanks, pushed to master.
Comment 2 Michael Natterer 2017-10-15 15:50:27 UTC
Niels, since you seem to be into the issue, do you know or can you check
if gettext now handles everything GIMP needs?
Comment 3 Niels De Graef 2017-10-17 23:03:38 UTC
I wouldn't call myself an expert on this (I've been mostly figuring things out by looking at how others did it), but normally gettext should be able to replace intltool for all your needs (for example, you can specify your own ITS and LOC files together with a custom GETTEXTDATADIRS variable). I'll see if I can post a WIP patch some time soon.
Comment 4 Debarshi Ray 2017-11-13 14:08:22 UTC
Review of attachment 361616 [details] [review]:

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

We lost the -0.3 suffix in the installed *.mo files. Would be nice to restore it for parallel installability.

It's not a catastrophe because gegl-0.2's files have the -0.2 suffix, so we can still parallel install gegl-0.2 and gegl-0.3, but it will become a problem in future.
Comment 5 Debarshi Ray 2017-11-13 14:09:04 UTC
Created attachment 363509 [details] [review]
Restore the versioning of the installed *.mo files
Comment 6 Øyvind Kolås (pippin) 2017-11-13 14:25:22 UTC
make distcheck fails with the following with attach 36509 applied:

config.status: creating operations/workshop/generated/Makefile
config.status: error: cannot find input file: `po/Makevars.in'
Makefile:842: recipe for target 'distcheck' failed
make: *** [distcheck] Error 1
Comment 7 Debarshi Ray 2017-11-14 12:29:01 UTC
Created attachment 363575 [details] [review]
Restore the versioning of the installed *.mo files

EXTRA_DIST:ing the po/Makevars.in gets us a bit further along till:
  ERROR: files left in build directory after distclean

Might be suppressable with distcleancheck_listfiles:
  https://www.gnu.org/software/automake/manual/html_node/Checking-the-Distribution.html#Checking-the-Distribution

The other solution is to just hard code the version suffix. :)
Comment 8 Debarshi Ray 2017-11-14 14:59:08 UTC
Created attachment 363596 [details] [review]
Restore the versioning of the installed *.mo files

Use distcleancheck_listfiles to nuke the distcheck complaint. Can't say that I find this better than just hard coding the -0.3 suffix, but there is nothing like build system surgery on a nice autumn afternoon. :)
Comment 9 Øyvind Kolås (pippin) 2017-11-14 15:11:37 UTC
Review of attachment 363596 [details] [review]:

commited
Comment 10 Øyvind Kolås (pippin) 2017-11-14 15:12:07 UTC
commit dc19cf4fd198eae137ce06ca08f6c1e847dc1678
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Mon Nov 13 15:07:18 2017 +0100

    Restore the versioning of the installed *.mo files
    
    It seems slightly more elegant to use the GETTEXT_PACKAGE output
    variable instead of hard coding the version suffix in po/Makevars.
    
    Unfortunately, I couldn't find a way to not distribute the generated
    po/Makevars, or a way to insert custom variables in Gettext's
    Makevars. Failing that, since the value of GETTEXT_PACKAGE isn't going
    to change as a result of configuring the build, we stop distcheck from
    complaining about po/Makevars not getting removed after distclean by
    using distcleancheck_listfiles.
    
    Fallout from 37262520be05d3903d142c6cfe655bc727596ded
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789010
Comment 11 Debarshi Ray 2017-11-14 15:41:40 UTC
(In reply to Øyvind Kolås (pippin) from comment #10)
> commit dc19cf4fd198eae137ce06ca08f6c1e847dc1678
> Author: Debarshi Ray <debarshir@gnome.org>
> Date:   Mon Nov 13 15:07:18 2017 +0100
> 
>     Restore the versioning of the installed *.mo files

Oops! This broke builddir != srcdir builds in GNOME Continuous:
http://build.gnome.org/continuous/buildmaster/builds/2017/11/14/25/build/log-gegl.txt
Comment 12 Debarshi Ray 2017-11-14 15:52:28 UTC
Created attachment 363610 [details] [review]
Restore the versioning of the installed *.mo files (v2)
Comment 13 Debarshi Ray 2017-11-14 15:52:54 UTC
commit 22d00b5d810f934e6b954894a66206c05fb7e46b
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Tue Nov 14 16:38:20 2017 +0100

    Restore the versioning of the installed *.mo files (v2)
    
    Hard code the API suffix in po/Makevars instead of trying to use custom
    Automake variables. This is also what GTK+ does, and simplicity does
    have its virtues.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789010

commit 8b8d302c9981b5e984e720a3f7461340fb8971ba
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Tue Nov 14 16:32:27 2017 +0100

    Revert "Restore the versioning of the installed *.mo files"
    
    This broke builddir != srcdir builds in GNOME Continuous:
      Making all in po
      make[2]: Entering directory '/ostbuild/source/gegl/_build/po'
      make[2]: *** No rule to make target '/config.status', needed by
        'Makefile'.  Stop.
      make[2]: Leaving directory '/ostbuild/source/gegl/_build/po'
      Makefile:643: recipe for target 'all-recursive' failed
      make[1]: *** [all-recursive] Error 1
      make[1]: Leaving directory '/ostbuild/source/gegl/_build'
      Makefile:550: recipe for target 'all' failed
      make: *** [all] Error 2
    
    This reverts commit dc19cf4fd198eae137ce06ca08f6c1e847dc1678.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789010
Comment 14 Kevin Cozens 2018-04-15 03:31:04 UTC
The extraction of strings using intltool-update broke when the support for Scheme based scripts was changed in a way that meant it no longer recognized the strings marked as translatable in scripts used by Script-Fu.

Some additional information relating to the change can be found at:
    Use xgettext's native support for scheme file string extraction
    https://bugs.launchpad.net/intltool/+bug/790574