[evince] build: Migrate from Intltool to Gettext



commit 4fd682132430feb8c012e4b0aa0c2c5da5ffe5ac
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Thu Sep 27 22:38:54 2018 +0200

    build: Migrate from Intltool to Gettext
    
    Recent versions of Gettext are able to translate several formats
    that are used in GNOME applications.
    
    Both autotools and meson have been migrated from Intltool to
    Gettext.

 Makefile.am                                        | 11 +--
 backend/comics/Makefile.am                         | 12 ++--
 ...=> comicsdocument.evince-backend.desktop.in.in} |  2 +-
 .../evince-comicsdocument.metainfo.xml.in.in       |  4 +-
 backend/djvu/Makefile.am                           | 12 ++--
 ...n => djvudocument.evince-backend.desktop.in.in} |  2 +-
 .../djvu/evince-djvudocument.metainfo.xml.in.in    |  4 +-
 backend/dvi/Makefile.am                            | 12 ++--
 ...in => dvidocument.evince-backend.desktop.in.in} |  2 +-
 backend/dvi/evince-dvidocument.metainfo.xml.in.in  |  4 +-
 backend/meson.build                                | 12 ++--
 backend/pdf/Makefile.am                            | 12 ++--
 backend/pdf/evince-pdfdocument.metainfo.xml.in.in  |  4 +-
 ...in => pdfdocument.evince-backend.desktop.in.in} |  2 +-
 backend/ps/Makefile.am                             | 12 ++--
 backend/ps/evince-psdocument.metainfo.xml.in.in    |  4 +-
 ....in => psdocument.evince-backend.desktop.in.in} |  2 +-
 backend/tiff/Makefile.am                           | 12 ++--
 .../tiff/evince-tiffdocument.metainfo.xml.in.in    |  4 +-
 ...n => tiffdocument.evince-backend.desktop.in.in} |  2 +-
 backend/xps/Makefile.am                            | 12 ++--
 backend/xps/evince-xpsdocument.metainfo.xml.in.in  |  4 +-
 ...in => xpsdocument.evince-backend.desktop.in.in} |  2 +-
 configure.ac                                       | 25 ++++---
 data/Makefile.am                                   | 16 ++---
 data/meson.build                                   | 15 ++---
 data/org.gnome.Evince-previewer.desktop.in.in      |  6 +-
 data/org.gnome.Evince.desktop.in.in                |  9 +--
 ...gschema.xml.in => org.gnome.Evince.gschema.xml} | 21 +++---
 meson.build                                        |  9 +--
 org.gnome.Evince.appdata.xml.in                    | 12 ++--
 po/Makevars                                        | 78 ++++++++++++++++++++++
 po/POTFILES.in                                     | 29 ++++----
 po/meson.build                                     |  6 +-
 34 files changed, 236 insertions(+), 139 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 39fe7d54..2bfe61bd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,14 +49,12 @@ appdatadir = $(datadir)/metainfo
 appdata_in_files = org.gnome.Evince.appdata.xml.in
 nodist_appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 
-@INTLTOOL_XML_RULE@
+org.gnome.Evince.appdata.xml: org.gnome.Evince.appdata.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 # Applications 
 
-intltool_extra = intltool-extract.in intltool-merge.in intltool-update.in
-
 EXTRA_DIST = \
-       $(intltool_extra) \
        $(header_DATA) \
        $(appdata_in_files) \
        autogen.sh \
@@ -67,10 +65,7 @@ CLEANFILES = \
        $(nodist_appdata_DATA) \
        $(NULL)
 
-DISTCLEANFILES =               \
-       intltool-extract        \
-       intltool-merge          \
-       intltool-update
+DISTCLEANFILES = 
 
 MAINTAINERCLEANFILES = \
        ChangeLog \
diff --git a/backend/comics/Makefile.am b/backend/comics/Makefile.am
index bc942e69..939ead63 100644
--- a/backend/comics/Makefile.am
+++ b/backend/comics/Makefile.am
@@ -28,14 +28,18 @@ libcomicsdocument_la_LIBADD =                               \
        $(BACKEND_LIBS)                                 \
        $(LIB_LIBS)
 
-backend_in_files = comicsdocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = comicsdocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+comicsdocument.evince-backend: comicsdocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-comicsdocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-comicsdocument.metainfo.xml: evince-comicsdocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 noinst_PROGRAMS = test-ev-archive
 
diff --git a/backend/comics/comicsdocument.evince-backend.in.in 
b/backend/comics/comicsdocument.evince-backend.desktop.in.in
similarity index 70%
rename from backend/comics/comicsdocument.evince-backend.in.in
rename to backend/comics/comicsdocument.evince-backend.desktop.in.in
index d2c23a0c..a93a1fbd 100644
--- a/backend/comics/comicsdocument.evince-backend.in.in
+++ b/backend/comics/comicsdocument.evince-backend.desktop.in.in
@@ -1,4 +1,4 @@
 [Evince Backend]
 Module=comicsdocument
-_TypeDescription=Comic Books
+TypeDescription=Comic Books
 MimeType=@COMICS_MIME_TYPES@;
diff --git a/backend/comics/evince-comicsdocument.metainfo.xml.in.in 
b/backend/comics/evince-comicsdocument.metainfo.xml.in.in
index 4c441d3b..51117c17 100644
--- a/backend/comics/evince-comicsdocument.metainfo.xml.in.in
+++ b/backend/comics/evince-comicsdocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-comicsdocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>Comic Books</_name>
-  <_summary>Adds support for reading comic books</_summary>
+  <name>Comic Books</name>
+  <summary>Adds support for reading comic books</summary>
   <mimetypes>
     @APPDATA_COMICS_MIME_TYPES@
   </mimetypes>
diff --git a/backend/djvu/Makefile.am b/backend/djvu/Makefile.am
index 0a511490..8bc7f8e3 100644
--- a/backend/djvu/Makefile.am
+++ b/backend/djvu/Makefile.am
@@ -28,14 +28,18 @@ libdjvudocument_la_LIBADD =                         \
        $(BACKEND_LIBS)                                 \
        $(DJVU_LIBS)
 
-backend_in_files = djvudocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = djvudocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+djvudocument.evince-backend: djvudocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-djvudocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-djvudocument.metainfo.xml: evince-djvudocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/djvu/djvudocument.evince-backend.in.in 
b/backend/djvu/djvudocument.evince-backend.desktop.in.in
similarity index 67%
rename from backend/djvu/djvudocument.evince-backend.in.in
rename to backend/djvu/djvudocument.evince-backend.desktop.in.in
index c834cf5a..38e722aa 100644
--- a/backend/djvu/djvudocument.evince-backend.in.in
+++ b/backend/djvu/djvudocument.evince-backend.desktop.in.in
@@ -1,4 +1,4 @@
 [Evince Backend]
 Module=djvudocument
-_TypeDescription=DjVu Documents
+TypeDescription=DjVu Documents
 MimeType=@DJVU_MIME_TYPES@;
diff --git a/backend/djvu/evince-djvudocument.metainfo.xml.in.in 
b/backend/djvu/evince-djvudocument.metainfo.xml.in.in
index f48a8cb2..74677cae 100644
--- a/backend/djvu/evince-djvudocument.metainfo.xml.in.in
+++ b/backend/djvu/evince-djvudocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-djvudocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>DjVu Documents</_name>
-  <_summary>Adds support for reading DjVu documents</_summary>
+  <name>DjVu Documents</name>
+  <summary>Adds support for reading DjVu documents</summary>
   <mimetypes>
     @APPDATA_DJVU_MIME_TYPES@
   </mimetypes>
diff --git a/backend/dvi/Makefile.am b/backend/dvi/Makefile.am
index ec2481c3..0f28a3d5 100644
--- a/backend/dvi/Makefile.am
+++ b/backend/dvi/Makefile.am
@@ -37,14 +37,18 @@ if WITH_TYPE1_FONTS
 libdvidocument_la_LIBADD += -lt1
 endif
 
-backend_in_files = dvidocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = dvidocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+dvidocument.evince-backend: dvidocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-dvidocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-dvidocument.metainfo.xml: evince-dvidocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/dvi/dvidocument.evince-backend.in.in 
b/backend/dvi/dvidocument.evince-backend.desktop.in.in
similarity index 67%
rename from backend/dvi/dvidocument.evince-backend.in.in
rename to backend/dvi/dvidocument.evince-backend.desktop.in.in
index fa7863ba..8c2c2f02 100644
--- a/backend/dvi/dvidocument.evince-backend.in.in
+++ b/backend/dvi/dvidocument.evince-backend.desktop.in.in
@@ -1,4 +1,4 @@
 [Evince Backend]
 Module=dvidocument
-_TypeDescription=DVI Documents
+TypeDescription=DVI Documents
 MimeType=@DVI_MIME_TYPES@;
diff --git a/backend/dvi/evince-dvidocument.metainfo.xml.in.in 
b/backend/dvi/evince-dvidocument.metainfo.xml.in.in
index ae5c98bf..fb89c00e 100644
--- a/backend/dvi/evince-dvidocument.metainfo.xml.in.in
+++ b/backend/dvi/evince-dvidocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-dvidocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>DVI Documents</_name>
-  <_summary>Adds support for reading DVI documents</_summary>
+  <name>DVI Documents</name>
+  <summary>Adds support for reading DVI documents</summary>
   <mimetypes>
     @APPDATA_DVI_MIME_TYPES@
   </mimetypes>
diff --git a/backend/meson.build b/backend/meson.build
index 716d9468..d1f6fe07 100644
--- a/backend/meson.build
+++ b/backend/meson.build
@@ -1,3 +1,5 @@
+msgfmt = find_program('msgfmt')
+
 backends_incs = [top_inc]
 
 backends_deps = [libevdocument_dep]
@@ -28,8 +30,8 @@ foreach backend, backend_mime_types: backends
   backend_desc = backend_name + '.evince-backend'
 
   backend_desc_in = configure_file(
-    input: '@0@/@1  in in'.format(backend, backend_desc),
-    output: backend_desc + '.in',
+    input: '@0@/@1  desktop in in'.format(backend, backend_desc),
+    output: backend_desc + 'desktop.in',
     configuration: backend_mime_types_conf,
   )
 
@@ -37,7 +39,7 @@ foreach backend, backend_mime_types: backends
     backend_desc,
     input: backend_desc_in,
     output: backend_desc,
-    command: intltool_desktop_cmd,
+    command: [msgfmt, '--desktop', '--keyword=TypeDescription', '--template', '@INPUT@', '-d', po_dir, '-o', 
'@OUTPUT@'],
     install: true,
     install_dir: ev_backendsdir,
   )
@@ -50,11 +52,11 @@ foreach backend, backend_mime_types: backends
     configuration: backend_mime_types_conf,
   )
 
-  custom_target(
+  i18n.merge_file(
     appstream,
     input: appstream_in,
     output: appstream,
-    command: intltool_xml_cmd,
+    po_dir: po_dir,
     install: true,
     install_dir: ev_appstreamdir,
   )
diff --git a/backend/pdf/Makefile.am b/backend/pdf/Makefile.am
index 2ad299b6..b461cfa6 100644
--- a/backend/pdf/Makefile.am
+++ b/backend/pdf/Makefile.am
@@ -24,14 +24,18 @@ libpdfdocument_la_LIBADD =                          \
        $(CAIRO_PDF_LIBS)                               \
        $(CAIRO_PS_LIBS)
 
-backend_in_files = pdfdocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = pdfdocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+pdfdocument.evince-backend: pdfdocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-pdfdocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-pdfdocument.metainfo.xml: evince-pdfdocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/pdf/evince-pdfdocument.metainfo.xml.in.in 
b/backend/pdf/evince-pdfdocument.metainfo.xml.in.in
index 6c5fcc8f..6e2533d1 100644
--- a/backend/pdf/evince-pdfdocument.metainfo.xml.in.in
+++ b/backend/pdf/evince-pdfdocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-pdfocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>PDF Documents</_name>
-  <_summary>Adds support for reading PDF Documents</_summary>
+  <name>PDF Documents</name>
+  <summary>Adds support for reading PDF Documents</summary>
   <mimetypes>
     @APPDATA_PDF_MIME_TYPES@
   </mimetypes>
diff --git a/backend/pdf/pdfdocument.evince-backend.in.in 
b/backend/pdf/pdfdocument.evince-backend.desktop.in.in
similarity index 71%
rename from backend/pdf/pdfdocument.evince-backend.in.in
rename to backend/pdf/pdfdocument.evince-backend.desktop.in.in
index e0facb74..037c71c4 100644
--- a/backend/pdf/pdfdocument.evince-backend.in.in
+++ b/backend/pdf/pdfdocument.evince-backend.desktop.in.in
@@ -1,6 +1,6 @@
 [Evince Backend]
 Module=pdfdocument
 Resident=true
-_TypeDescription=PDF Documents
+TypeDescription=PDF Documents
 MimeType=@PDF_MIME_TYPES@;
 
diff --git a/backend/ps/Makefile.am b/backend/ps/Makefile.am
index ae7c6b43..cac53e39 100644
--- a/backend/ps/Makefile.am
+++ b/backend/ps/Makefile.am
@@ -22,14 +22,18 @@ libpsdocument_la_LIBADD =                           \
        $(BACKEND_LIBS)                                 \
        $(SPECTRE_LIBS)
 
-backend_in_files = psdocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = psdocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+psdocument.evince-backend: psdocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-psdocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-psdocument.metainfo.xml: evince-psdocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/ps/evince-psdocument.metainfo.xml.in.in b/backend/ps/evince-psdocument.metainfo.xml.in.in
index 4f3d1fd1..b243597f 100644
--- a/backend/ps/evince-psdocument.metainfo.xml.in.in
+++ b/backend/ps/evince-psdocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-psdocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>PostScript Documents</_name>
-  <_summary>Adds support for reading PostScript documents</_summary>
+  <name>PostScript Documents</name>
+  <summary>Adds support for reading PostScript documents</summary>
   <mimetypes>
     @APPDATA_PS_MIME_TYPES@
   </mimetypes>
diff --git a/backend/ps/psdocument.evince-backend.in.in b/backend/ps/psdocument.evince-backend.desktop.in.in
similarity index 66%
rename from backend/ps/psdocument.evince-backend.in.in
rename to backend/ps/psdocument.evince-backend.desktop.in.in
index ea632576..94d94bd3 100644
--- a/backend/ps/psdocument.evince-backend.in.in
+++ b/backend/ps/psdocument.evince-backend.desktop.in.in
@@ -1,5 +1,5 @@
 [Evince Backend]
 Module=psdocument
 Resident=true
-_TypeDescription=PostScript Documents
+TypeDescription=PostScript Documents
 MimeType=@PS_MIME_TYPES@;
diff --git a/backend/tiff/Makefile.am b/backend/tiff/Makefile.am
index 4149e265..2e192afd 100644
--- a/backend/tiff/Makefile.am
+++ b/backend/tiff/Makefile.am
@@ -23,14 +23,18 @@ libtiffdocument_la_LIBADD =                                 \
        $(BACKEND_LIBS)                 \
        -ltiff
 
-backend_in_files = tiffdocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = tiffdocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+tiffdocument.evince-backend: tiffdocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-tiffdocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-tiffdocument.metainfo.xml: evince-tiffdocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/tiff/evince-tiffdocument.metainfo.xml.in.in 
b/backend/tiff/evince-tiffdocument.metainfo.xml.in.in
index e54ed74d..d90a477c 100644
--- a/backend/tiff/evince-tiffdocument.metainfo.xml.in.in
+++ b/backend/tiff/evince-tiffdocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-tiffdocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>TIFF Documents</_name>
-  <_summary>Adds support for reading TIFF documents</_summary>
+  <name>TIFF Documents</name>
+  <summary>Adds support for reading TIFF documents</summary>
   <mimetypes>
     @APPDATA_TIFF_MIME_TYPES@
   </mimetypes>
diff --git a/backend/tiff/tiffdocument.evince-backend.in.in 
b/backend/tiff/tiffdocument.evince-backend.desktop.in.in
similarity index 67%
rename from backend/tiff/tiffdocument.evince-backend.in.in
rename to backend/tiff/tiffdocument.evince-backend.desktop.in.in
index 951571a7..2e9b5e11 100644
--- a/backend/tiff/tiffdocument.evince-backend.in.in
+++ b/backend/tiff/tiffdocument.evince-backend.desktop.in.in
@@ -1,4 +1,4 @@
 [Evince Backend]
 Module=tiffdocument
-_TypeDescription=TIFF Documents
+TypeDescription=TIFF Documents
 MimeType=@TIFF_MIME_TYPES@;
diff --git a/backend/xps/Makefile.am b/backend/xps/Makefile.am
index 185a463f..95e2cca4 100644
--- a/backend/xps/Makefile.am
+++ b/backend/xps/Makefile.am
@@ -21,14 +21,18 @@ libxpsdocument_la_LIBADD =                          \
        $(BACKEND_LIBS)                                 \
        $(GXPS_LIBS)
 
-backend_in_files = xpsdocument.evince-backend.in.in
-backend_DATA = $(backend_in_files:.evince-backend.in.in=.evince-backend)
-@EV_INTLTOOL_EVINCE_BACKEND_RULE@
+backend_in_files = xpsdocument.evince-backend.desktop.in.in
+backend_DATA = $(backend_in_files:.evince-backend.desktop.in.in=.evince-backend)
+
+xpsdocument.evince-backend: xpsdocument.evince-backend.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=TypeDescription --template $< -d $(top_srcdir)/po -o $@
 
 appstreamdir = $(datadir)/metainfo
 appstream_in_files = evince-xpsdocument.metainfo.xml.in.in
 appstream_DATA = $(appstream_in_files:.xml.in.in=.xml)
-@INTLTOOL_XML_RULE@
+
+evince-xpsdocument.metainfo.xml: evince-xpsdocument.metainfo.xml.in
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 EXTRA_DIST = $(backend_in_files) $(appstream_in_files)
 
diff --git a/backend/xps/evince-xpsdocument.metainfo.xml.in.in 
b/backend/xps/evince-xpsdocument.metainfo.xml.in.in
index 557dfa7a..d1ece342 100644
--- a/backend/xps/evince-xpsdocument.metainfo.xml.in.in
+++ b/backend/xps/evince-xpsdocument.metainfo.xml.in.in
@@ -2,8 +2,8 @@
 <component type="addon">
   <id>evince-xpsdocument</id>
   <extends>org.gnome.Evince</extends>
-  <_name>XPS Documents</_name>
-  <_summary>Adds support for reading XPS documents</_summary>
+  <name>XPS Documents</name>
+  <summary>Adds support for reading XPS documents</summary>
   <mimetypes>
     @APPDATA_XPS_MIME_TYPES@
   </mimetypes>
diff --git a/backend/xps/xpsdocument.evince-backend.in.in 
b/backend/xps/xpsdocument.evince-backend.desktop.in.in
similarity index 71%
rename from backend/xps/xpsdocument.evince-backend.in.in
rename to backend/xps/xpsdocument.evince-backend.desktop.in.in
index cf6abb5c..6efefade 100644
--- a/backend/xps/xpsdocument.evince-backend.in.in
+++ b/backend/xps/xpsdocument.evince-backend.desktop.in.in
@@ -1,5 +1,5 @@
 [Evince Backend]
 Module=xpsdocument
 Resident=true
-_TypeDescription=XPS Documents
+TypeDescription=XPS Documents
 MimeType=@XPS_MIME_TYPES@;
diff --git a/configure.ac b/configure.ac
index 77e3cda3..097b8bad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,16 +74,15 @@ LT_LIB_M
 
 GNOME_CXX_WARNINGS
 
-IT_PROG_INTLTOOL([0.35.0])
+AX_REQUIRE_DEFINED([AM_GNU_GETTEXT_VERSION])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+
+AX_REQUIRE_DEFINED([AM_GNU_GETTEXT])
+AM_GNU_GETTEXT([external])
 
 GETTEXT_PACKAGE=evince
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
-AM_GLIB_GNU_GETTEXT
-
-m4_pattern_allow([AM_V_GEN])dnl Make autoconf not complain about the rule below
-EV_INTLTOOL_EVINCE_BACKEND_RULE='%.evince-backend:   %.evince-backend.in   $(INTLTOOL_MERGE) $(wildcard 
$(top_srcdir)/po/*.po) ; $(AM_V_GEN) LC_ALL=C $(INTLTOOL_MERGE) -d -u -c 
$(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
-AC_SUBST([EV_INTLTOOL_EVINCE_BACKEND_RULE])
 
 GLIB_GSETTINGS
 
@@ -923,27 +922,27 @@ AC_SUBST([AM_LDFLAGS])
 
 AC_CONFIG_FILES([
 backend/Makefile
-backend/comics/comicsdocument.evince-backend.in
+backend/comics/comicsdocument.evince-backend.desktop.in
 backend/comics/evince-comicsdocument.metainfo.xml.in
 backend/comics/Makefile
-backend/djvu/djvudocument.evince-backend.in
+backend/djvu/djvudocument.evince-backend.desktop.in
 backend/djvu/evince-djvudocument.metainfo.xml.in
 backend/djvu/Makefile
-backend/dvi/dvidocument.evince-backend.in
+backend/dvi/dvidocument.evince-backend.desktop.in
 backend/dvi/evince-dvidocument.metainfo.xml.in
 backend/dvi/Makefile
 backend/dvi/mdvi-lib/Makefile
 backend/pdf/evince-pdfdocument.metainfo.xml.in
-backend/pdf/pdfdocument.evince-backend.in
+backend/pdf/pdfdocument.evince-backend.desktop.in
 backend/pdf/Makefile
 backend/ps/evince-psdocument.metainfo.xml.in
-backend/ps/psdocument.evince-backend.in
+backend/ps/psdocument.evince-backend.desktop.in
 backend/ps/Makefile
 backend/tiff/evince-tiffdocument.metainfo.xml.in
-backend/tiff/tiffdocument.evince-backend.in
+backend/tiff/tiffdocument.evince-backend.desktop.in
 backend/tiff/Makefile
 backend/xps/evince-xpsdocument.metainfo.xml.in
-backend/xps/xpsdocument.evince-backend.in
+backend/xps/xpsdocument.evince-backend.desktop.in
 backend/xps/Makefile
 browser-plugin/Makefile
 cut-n-paste/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
index 777ed728..32580d59 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -21,14 +21,18 @@ ui_DATA =                           \
 # Desktop file
 #
 
-@INTLTOOL_DESKTOP_RULE@
-
 DESKTOP_IN_FILES= org.gnome.Evince.desktop.in.in org.gnome.Evince-previewer.desktop.in.in
 DESKTOP_FILES= $(DESKTOP_IN_FILES:.desktop.in.in=.desktop)
 
 desktopdir = $(datadir)/applications
 desktop_DATA = $(DESKTOP_FILES)
 
+org.gnome.Evince-previewer.desktop: org.gnome.Evince-previewer.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
+org.gnome.Evince.desktop: org.gnome.Evince.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
 #
 # DBus servide file
 #
@@ -63,14 +67,11 @@ endif
 #
 # GSettings schema
 #
-gsettingsschema_in_files = org.gnome.Evince.gschema.xml.in
 # gsettings_SCHEMAS is a list of all the schemas you want to install
-gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
+gsettings_SCHEMAS = org.gnome.Evince.gschema.xml
 
 .PRECIOUS: $(gsettings_SCHEMAS)
 
-@INTLTOOL_XML_NOMERGE_RULE@
-
 # include the appropriate makefile rules for schema handling
 @GSETTINGS_RULES@
 
@@ -103,7 +104,7 @@ update-icon-cache:
 EXTRA_DIST =                                   \
        $(ui_DATA)                              \
        $(DESKTOP_IN_FILES)                     \
-       $(gsettingsschema_in_files)             \
+       $(gsettings_SCHEMAS)                    \
        $(man_MANS)                             \
        $(service_in_files)                     \
        $(systemd_user_in_files)                \
@@ -118,7 +119,6 @@ EXTRA_DIST =                                        \
 
 DISTCLEANFILES = \
        $(DESKTOP_FILES)        \
-       $(gsettings_SCHEMAS)    \
        $(service_DATA)         \
        $(systemd_user_DATA)    \
        $(NULL)
diff --git a/data/meson.build b/data/meson.build
index be6ed210..8a44e935 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -14,11 +14,12 @@ foreach desktop: desktops
     configuration: mime_types_conf,
   )
 
-  custom_target(
+  i18n.merge_file(
     desktop,
+    type: 'desktop',
     input: desktop_in,
     output: desktop,
-    command: intltool_desktop_cmd,
+    po_dir: po_dir,
     install: true,
     install_dir: join_paths(ev_datadir, 'applications'),
   )
@@ -48,14 +49,8 @@ if enable_dbus
 endif
 
 # GSettings schema
-gschema = ev_namespace + '.gschema.xml'
-
-custom_target(
-  gschema,
-  input: gschema + '.in',
-  output: gschema,
-  command: [intltool_merge, '-x', '-u', '--no-translations', '@INPUT@', '@OUTPUT@'],
-  install: true,
+install_data(
+  ev_namespace + '.gschema.xml',
   install_dir: join_paths(ev_datadir, 'glib-2.0', 'schemas'),
 )
 
diff --git a/data/org.gnome.Evince-previewer.desktop.in.in b/data/org.gnome.Evince-previewer.desktop.in.in
index e7303198..61a97c36 100644
--- a/data/org.gnome.Evince-previewer.desktop.in.in
+++ b/data/org.gnome.Evince-previewer.desktop.in.in
@@ -1,12 +1,12 @@
 [Desktop Entry]
-_Name=Print Preview
-_Comment=Preview before printing
+Name=Print Preview
+Comment=Preview before printing
 TryExec=evince-previewer
 Exec=evince-previewer %U
 StartupNotify=true
 Terminal=false
 Type=Application
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=document-print-preview
 NoDisplay=true
-X-GNOME-DocPath=
 Categories=GNOME;GTK;Office;Viewer;Graphics;2DGraphics;VectorGraphics;
diff --git a/data/org.gnome.Evince.desktop.in.in b/data/org.gnome.Evince.desktop.in.in
index dbe87deb..c45703c8 100644
--- a/data/org.gnome.Evince.desktop.in.in
+++ b/data/org.gnome.Evince.desktop.in.in
@@ -1,13 +1,14 @@
 [Desktop Entry]
-_Name=Document Viewer
-_Comment=View multi-page documents
-_Keywords=pdf;ps;postscript;dvi;xps;djvu;tiff;document;presentation;viewer;
+Name=Document Viewer
+Comment=View multi-page documents
+# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list 
MUST also end with a semicolon!
+Keywords=pdf;ps;postscript;dvi;xps;djvu;tiff;document;presentation;viewer;
 TryExec=evince
 Exec=evince %U
 StartupNotify=true
 Terminal=false
 Type=Application
+# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=org.gnome.Evince
-X-GNOME-DocPath=
 Categories=GNOME;GTK;Office;Viewer;Graphics;2DGraphics;VectorGraphics;
 MimeType=@EVINCE_MIME_TYPES@;
diff --git a/data/org.gnome.Evince.gschema.xml.in b/data/org.gnome.Evince.gschema.xml
similarity index 72%
rename from data/org.gnome.Evince.gschema.xml.in
rename to data/org.gnome.Evince.gschema.xml
index fda312bf..604eb48b 100644
--- a/data/org.gnome.Evince.gschema.xml.in
+++ b/data/org.gnome.Evince.gschema.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
 
   <enum id="org.gnome.Evince.SizingMode">
@@ -10,34 +11,34 @@
   <schema id="org.gnome.Evince" path="/org/gnome/evince/" gettext-domain="evince">
     <key name="override-restrictions" type="b">
       <default>true</default>
-      <_summary>Override document restrictions</_summary>
-      <_description>Override document restrictions, like restriction to copy or to print.</_description>
+      <summary>Override document restrictions</summary>
+      <description>Override document restrictions, like restriction to copy or to print.</description>
     </key>
     <key name="auto-reload" type="b">
       <default>true</default>
-      <_summary>Automatically reload the document</_summary>
-      <_description>The document is automatically reloaded on file change.</_description>
+      <summary>Automatically reload the document</summary>
+      <description>The document is automatically reloaded on file change.</description>
     </key>
     <key name="document-directory" type="ms">
       <default>nothing</default>
-      <_summary>The URI of the directory last used to open or save a document</_summary>
+      <summary>The URI of the directory last used to open or save a document</summary>
     </key>
     <key name="pictures-directory" type="ms">
       <default>nothing</default>
-      <_summary>The URI of the directory last used to save a picture</_summary>
+      <summary>The URI of the directory last used to save a picture</summary>
     </key>
     <key name="page-cache-size" type="u">
       <default>50</default>
-      <_summary>Page cache size in MiB</_summary>
-      <_description>The maximum size that will be used to cache rendered pages, limits maximum zoom 
level.</_description>
+      <summary>Page cache size in MiB</summary>
+      <description>The maximum size that will be used to cache rendered pages, limits maximum zoom 
level.</description>
     </key>
     <key name="show-caret-navigation-message" type="b">
       <default>true</default>
-      <_summary>Show a dialog to confirm that the user wants to activate the caret navigation.</_summary>
+      <summary>Show a dialog to confirm that the user wants to activate the caret navigation.</summary>
     </key>
     <key type="b" name="allow-links-change-zoom">
       <default>true</default>
-      <_summary>Allow links to change the zoom level.</_summary>
+      <summary>Allow links to change the zoom level.</summary>
     </key>
     <child name="default" schema="org.gnome.Evince.Default"/>
   </schema>
diff --git a/meson.build b/meson.build
index 26b910af..b3e12240 100644
--- a/meson.build
+++ b/meson.build
@@ -135,11 +135,6 @@ source_root = meson.current_source_dir()
 data_dir = join_paths(source_root, 'data')
 po_dir = join_paths(source_root, 'po')
 
-intltool_merge = find_program('intltool-merge')
-intltool_cache = join_paths(po_dir, '.intltool-merge-cache')
-intltool_desktop_cmd = [intltool_merge, '-d', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-intltool_xml_cmd = [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@']
-
 top_inc = include_directories('.')
 
 glib_req_version = '>= 2.36.0'
@@ -491,11 +486,11 @@ install_headers(
 # Appdata files
 appdata = ev_namespace + '.appdata.xml'
 
-custom_target(
+i18n.merge_file(
   appdata,
   input: appdata + '.in',
   output: appdata,
-  command: intltool_xml_cmd,
+  po_dir: po_dir,
   install: true,
   install_dir: ev_appstreamdir,
 )
diff --git a/org.gnome.Evince.appdata.xml.in b/org.gnome.Evince.appdata.xml.in
index dc47d253..2d4e5248 100644
--- a/org.gnome.Evince.appdata.xml.in
+++ b/org.gnome.Evince.appdata.xml.in
@@ -20,11 +20,11 @@
   <launchable type="desktop-id">org.gnome.Evince.desktop</launchable>
   <metadata_license>GPL-2.0+ or GFDL-1.3-only</metadata_license>
   <project_license>GPL-2.0+</project_license>
-  <_name>Evince</_name>
-  <_summary>Document viewer for popular document formats</_summary>
+  <name>Evince</name>
+  <summary>Document viewer for popular document formats</summary>
   <description>
-    <_p>A document viewer for the GNOME desktop. You can view, search or annotate documents in many 
different formats.</_p>
-    <_p>Evince supports documents in: PDF, PS, EPS, XPS, DjVu, TIFF, DVI (with SyncTeX), and Comic Books 
archives (CBR, CBT, CBZ, CB7).</_p>
+    <p>A document viewer for the GNOME desktop. You can view, search or annotate documents in many different 
formats.</p>
+    <p>Evince supports documents in: PDF, PS, EPS, XPS, DjVu, TIFF, DVI (with SyncTeX), and Comic Books 
archives (CBR, CBT, CBZ, CB7).</p>
   </description>
   <provides>
     <id>evince.desktop</id>
@@ -32,11 +32,11 @@
   <screenshots>
     <screenshot type="default">
     <image>https://gitlab.gnome.org/GNOME/evince/raw/master/data/screenshots/evince-1.png</image>
-    <_caption>A clear, simple UI</_caption>
+    <caption>A clear, simple UI</caption>
     </screenshot>
     <screenshot>
     <image>https://gitlab.gnome.org/GNOME/evince/raw/master/data/screenshots/evince-2.png</image>
-    <_caption>Advanced highlighting and annotation</_caption>
+    <caption>Advanced highlighting and annotation</caption>
     </screenshot>
   </screenshots>
   <url type="homepage">https://wiki.gnome.org/Apps/Evince</url>
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 00000000..ede1f0c6
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,78 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 
--keyword=g_dngettext:2,3 --keyword=TypeDescription --add-comments
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Evince Authors
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU = no
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = https://gitlab.gnome.org/GNOME/evince/issues
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = yes
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# These options get passed to msginit.
+# If you want to disable line wrapping when writing PO files, add
+# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and
+# MSGINIT_OPTIONS.
+MSGINIT_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = no
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = no
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 41236467..8abbc23a 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,30 +1,29 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
 backend/comics/comics-document.c
-[type: gettext/ini]backend/comics/comicsdocument.evince-backend.in.in
+backend/comics/comicsdocument.evince-backend.desktop.in.in
 backend/comics/evince-comicsdocument.metainfo.xml.in.in
 backend/djvu/djvu-document.c
-[type: gettext/ini]backend/djvu/djvudocument.evince-backend.in.in
+backend/djvu/djvudocument.evince-backend.desktop.in.in
 backend/djvu/evince-djvudocument.metainfo.xml.in.in
 backend/dvi/dvi-document.c
-[type: gettext/ini]backend/dvi/dvidocument.evince-backend.in.in
+backend/dvi/dvidocument.evince-backend.desktop.in.in
 backend/dvi/evince-dvidocument.metainfo.xml.in.in
-backend/pdf/ev-poppler.cc
 backend/pdf/evince-pdfdocument.metainfo.xml.in.in
-[type: gettext/ini]backend/pdf/pdfdocument.evince-backend.in.in
-backend/ps/ev-spectre.c
+backend/pdf/ev-poppler.cc
+backend/pdf/pdfdocument.evince-backend.desktop.in.in
 backend/ps/evince-psdocument.metainfo.xml.in.in
-[type: gettext/ini]backend/ps/psdocument.evince-backend.in.in
-backend/tiff/tiff-document.c
+backend/ps/ev-spectre.c
+backend/ps/psdocument.evince-backend.desktop.in.in
 backend/tiff/evince-tiffdocument.metainfo.xml.in.in
-[type: gettext/ini]backend/tiff/tiffdocument.evince-backend.in.in
+backend/tiff/tiff-document.c
+backend/tiff/tiffdocument.evince-backend.desktop.in.in
 backend/xps/evince-xpsdocument.metainfo.xml.in.in
-[type: gettext/ini]backend/xps/xpsdocument.evince-backend.in.in
+backend/xps/xpsdocument.evince-backend.desktop.in.in
 browser-plugin/EvBrowserPluginToolbar.cpp
 data/org.gnome.Evince.desktop.in.in
+data/org.gnome.Evince.gschema.xml
 data/org.gnome.Evince-previewer.desktop.in.in
-data/org.gnome.Evince.gschema.xml.in
 libdocument/ev-attachment.c
 libdocument/ev-document-factory.c
 libdocument/ev-file-helpers.c
@@ -36,6 +35,7 @@ libview/ev-print-operation.c
 libview/ev-view-accessible.c
 libview/ev-view.c
 libview/ev-view-presentation.c
+org.gnome.Evince.appdata.xml.in
 previewer/ev-previewer.c
 previewer/ev-previewer-window.c
 properties/ev-properties-main.c
@@ -44,6 +44,7 @@ shell/ev-annotation-properties-dialog.c
 shell/ev-annotations-toolbar.c
 shell/ev-application.c
 shell/ev-history.c
+shell/evince-menus.ui
 shell/ev-keyring.c
 shell/ev-loading-message.c
 shell/ev-password-view.c
@@ -61,7 +62,5 @@ shell/ev-utils.c
 shell/ev-window.c
 shell/ev-window-title.c
 shell/ev-zoom-action.c
+shell/help-overlay.ui
 shell/main.c
-[type: gettext/glade]shell/evince-menus.ui
-[type: gettext/glade]shell/help-overlay.ui
-org.gnome.Evince.appdata.xml.in
diff --git a/po/meson.build b/po/meson.build
index f4f1c436..55413e00 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -1 +1,5 @@
-i18n.gettext(ev_name, preset: 'glib')
+i18n.gettext(
+  ev_name,
+  preset: 'glib',
+  args: '--keyword=TypeDescription',
+)



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