[eog] Convert from intltool to gettext



commit cda433d5a9020074156f16a86148d09121249f67
Author: Felix Riemann <friemann gnome org>
Date:   Sun Jun 4 13:16:25 2017 +0200

    Convert from intltool to gettext
    
    See https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration

 Makefile.am                                        |    7 +-
 autogen.sh                                         |    1 -
 configure.ac                                       |    6 +-
 data/Makefile.am                                   |   16 +++-
 data/{eog-app-menu.xml => eog-app-menu.ui}         |    0
 data/eog.appdata.xml.in                            |   12 ++--
 data/eog.desktop.in.in                             |   11 ++-
 plugins/Makefile.am                                |    8 ++-
 plugins/fullscreen/fullscreen.plugin.desktop.in    |    4 +-
 plugins/reload/reload.plugin.desktop.in            |    4 +-
 .../statusbar-date.plugin.desktop.in               |    4 +-
 po/Makevars                                        |   78 ++++++++++++++++++++
 po/POTFILES.in                                     |   23 +++---
 src/eog.gresource.xml                              |    2 +-
 14 files changed, 133 insertions(+), 43 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 5e2d014..a523d4d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,7 +2,7 @@ if ENABLE_JPEG
 jpeg_DIRS = jpegutils
 endif
 
-SUBDIRS = $(jpeg_DIRS) src plugins po help data doc
+SUBDIRS = $(jpeg_DIRS) src plugins help data doc po
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 
@@ -14,10 +14,7 @@ EXTRA_DIST =                         \
        ChangeLog.pre-git       \
        tests
 
-DISTCLEANFILES =                \
-        intltool-extract        \
-        intltool-merge          \
-        intltool-update
+DISTCLEANFILES =
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-installed-tests
 
diff --git a/autogen.sh b/autogen.sh
index 0952c5c..c30aa83 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -19,7 +19,6 @@ which gnome-autogen.sh || {
 
 REQUIRED_AUTOCONF_VERSION=2.59
 REQUIRED_AUTOMAKE_VERSION=1.11
-REQUIRED_INTLTOOL_VERSION=0.40.0
 REQUIRED_PKG_CONFIG_VERSION=0.16.0
 REQUIRED_GTK_DOC_VERSION=1.9
 USE_GNOME2_MACROS=1 . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index 988eb16..38d61d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,13 +65,13 @@ fi
 # Translation
 # ***********
 
-AM_GLIB_GNU_GETTEXT
-IT_PROG_INTLTOOL([0.50.1])
-
 GETTEXT_PACKAGE=AC_PACKAGE_NAME
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Gettext package.])
 
+AM_GNU_GETTEXT_VERSION([0.19.7])
+AM_GNU_GETTEXT([external])
+
 AC_SUBST(CFLAGS)
 AC_SUBST(LDFLAGS)
 
diff --git a/data/Makefile.am b/data/Makefile.am
index fba42cd..b376d31 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,18 +1,23 @@
 SUBDIRS = pixmaps icons
 
-@INTLTOOL_DESKTOP_RULE@
-
+# .desktop file
 DESKTOP_IN_FILES= eog.desktop.in.in
 DESKTOP_FILES= $(DESKTOP_IN_FILES:.desktop.in.in=.desktop)
 
 desktopdir = $(datadir)/applications
 desktop_DATA = $(DESKTOP_FILES)
 
-@INTLTOOL_XML_RULE@
+$(desktop_DATA): %.desktop: %.desktop.in
+       $(AM_V_GEN)$(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
+
+# AppData
 appdatadir = $(datadir)/appdata
 appdata_in_files = eog.appdata.xml.in
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
+$(appdata_DATA): $(appdata_in_files)
+       $(AM_V_GEN)$(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
+# GSettings
 gsettings_ENUM_NAMESPACE = org.gnome.eog
 gsettings_ENUM_FILES = $(top_srcdir)/src/eog-scroll-view.h     \
                        $(top_srcdir)/src/eog-window.h
@@ -23,13 +28,15 @@ gsettings_SCHEMAS = org.gnome.eog.gschema.xml
 gsettingsconvertdir = $(datadir)/GConf/gsettings
 gsettingsconvert_DATA = eog.convert
 
+# pkg-config
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = eog.pc
 
+
 EXTRA_DIST =                   \
        fullscreen-toolbar.ui   \
        eog.css                 \
-       eog-app-menu.xml        \
+       eog-app-menu.ui         \
        eog-gear-menu.ui        \
        eog-image-properties-dialog.ui  \
        eog-multiple-save-as-dialog.ui  \
@@ -43,6 +50,7 @@ EXTRA_DIST =                  \
        eog.convert
 
 CLEANFILES =                   \
+        $(DESKTOP_FILES)        \
        $(appdata_DATA)
 
 DISTCLEANFILES =               \
diff --git a/data/eog-app-menu.xml b/data/eog-app-menu.ui
similarity index 100%
rename from data/eog-app-menu.xml
rename to data/eog-app-menu.ui
diff --git a/data/eog.appdata.xml.in b/data/eog.appdata.xml.in
index 3cac76a..e769fc0 100644
--- a/data/eog.appdata.xml.in
+++ b/data/eog.appdata.xml.in
@@ -3,20 +3,20 @@
   <id>eog.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+ and GFDL-1.3</project_license>
-  <_name>Eye of GNOME</_name>
-  <_summary>Browse and rotate images</_summary>
+  <name>Eye of GNOME</name>
+  <summary>Browse and rotate images</summary>
   <description>
-    <_p>
+    <p>
       The Eye of GNOME is the official image viewer for the GNOME desktop.
       It integrates with the GTK+ look and feel of GNOME, and supports many image
       formats for viewing single images or images in a collection.
-    </_p>
-    <_p>
+    </p>
+    <p>
       The Eye of GNOME also allows to view the images in a fullscreen slideshow mode
       or set an image as the desktop wallpaper.
       It reads the camera tags to automatically rotate your images in the correct
       portrait or landscape orientation.
-    </_p>
+    </p>
   </description>
   <url type="homepage">https://wiki.gnome.org/Apps/EyeOfGnome</url>
   <url type="bugtracker">https://bugzilla.gnome.org/enter_bug.cgi?product=eog</url>
diff --git a/data/eog.desktop.in.in b/data/eog.desktop.in.in
index 672ee81..df858a8 100644
--- a/data/eog.desktop.in.in
+++ b/data/eog.desktop.in.in
@@ -1,8 +1,10 @@
 [Desktop Entry]
-_Name=Image Viewer
-_Comment=Browse and rotate images
+Name=Image Viewer
+Comment=Browse and rotate images
 TryExec=eog
 Exec=eog %U
+# TRANSLATORS: Do NOT translate or transliterate this text!
+# This is an icon file name
 Icon=eog
 StartupNotify=true
 Terminal=false
@@ -15,4 +17,7 @@ X-GNOME-Bugzilla-Version=@VERSION@
 X-GNOME-DocPath=eog/eog.xml
 
MimeType=image/bmp;image/gif;image/jpeg;image/jpg;image/pjpeg;image/png;image/tiff;image/x-bmp;image/x-gray;image/x-icb;image/x-ico;image/x-png;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-xbitmap;image/x-xpixmap;image/x-pcx;image/svg+xml;image/svg+xml-compressed;image/vnd.wap.wbmp;
 # Extra keywords that can be used to search for eog in GNOME Shell and Unity
-_Keywords=Picture;Slideshow;Graphics;
+# TRANSLATORS: Search terms to find this application.
+#              Do NOT translate or localize the semicolons!
+#              The list MUST also end with a semicolon!
+Keywords=Picture;Slideshow;Graphics;
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 8852905..4026dca 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -52,10 +52,14 @@ plugins_in_files += statusbar-date/statusbar-date.plugin.desktop.in
 endif
 
 # Generate plugin info files
+plugins_DATA = $(plugins_in_files:.plugin.desktop.in=.plugin)
+
+# msgfmt 0.19.8 has a bug that adding additional keywords for translation
+# disables the default keywords, so we have to explicitly name them for now.
+$(plugins_DATA): %.plugin: %.plugin.desktop.in $(wildcard $(top_srcdir)/po/*po)
+       $(AM_V_GEN)$(MSGFMT) --desktop --keyword=Name --keyword=Description --template $< -d $(top_srcdir)/po 
-o $@
 
-%.plugin: %.plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; 
$(AM_V_GEN)$(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
 
-plugins_DATA = $(plugins_in_files:.plugin.desktop.in=.plugin)
 
 DISTCLEANFILES = $(plugins_DATA)
 CLEANFILES = $(plugins_DATA)
diff --git a/plugins/fullscreen/fullscreen.plugin.desktop.in b/plugins/fullscreen/fullscreen.plugin.desktop.in
index 57c0e3a..d7d0151 100644
--- a/plugins/fullscreen/fullscreen.plugin.desktop.in
+++ b/plugins/fullscreen/fullscreen.plugin.desktop.in
@@ -1,9 +1,9 @@
 [Plugin]
 Module=fullscreen
 IAge=2
-_Name=Fullscreen with double-click
+Name=Fullscreen with double-click
 Icon=view-fullscreen
-_Description=Activate fullscreen mode with double-click
+Description=Activate fullscreen mode with double-click
 Authors=Lucas Rocha <lucasr gnome org>
 Copyright=Copyright © 2007 Lucas Rocha
 Website=http://www.gnome.org/projects/eog
diff --git a/plugins/reload/reload.plugin.desktop.in b/plugins/reload/reload.plugin.desktop.in
index 8dedd65..7b2fb79 100644
--- a/plugins/reload/reload.plugin.desktop.in
+++ b/plugins/reload/reload.plugin.desktop.in
@@ -1,9 +1,9 @@
 [Plugin]
 Module=reload
 IAge=3
-_Name=Reload Image
+Name=Reload Image
 Icon=view-refresh
-_Description=Reload current image
+Description=Reload current image
 Authors=Lucas Rocha <lucasr gnome org>
 Copyright=Copyright © 2007 Lucas Rocha
 Website=http://www.gnome.org/projects/eog
diff --git a/plugins/statusbar-date/statusbar-date.plugin.desktop.in 
b/plugins/statusbar-date/statusbar-date.plugin.desktop.in
index 93ed60d..78f69ae 100644
--- a/plugins/statusbar-date/statusbar-date.plugin.desktop.in
+++ b/plugins/statusbar-date/statusbar-date.plugin.desktop.in
@@ -1,8 +1,8 @@
 [Plugin]
 Module=statusbar-date
 IAge=2
-_Name=Date in statusbar
-_Description=Shows the image date in the window statusbar
+Name=Date in statusbar
+Description=Shows the image date in the window statusbar
 Authors=Claudio Saavedra  <csaavedra gnome org>
 Copyright=Copyright © 2008 Free Software Foundation
 Website=http://www.gnome.org/projects/eog
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..9e67bf9
--- /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=Description --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 = Eye of GNOME contributors
+
+# 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 =
+
+# 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 =
+
+# 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 5e3b53f..4743515 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,19 +1,18 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
-[type: gettext/glade]data/eog-app-menu.xml
+data/eog-app-menu.ui
 data/eog.appdata.xml.in
 data/eog.desktop.in.in
-[type: gettext/glade]data/eog-gear-menu.ui
-[type: gettext/glade]data/eog-image-properties-dialog.ui
-[type: gettext/glade]data/eog-multiple-save-as-dialog.ui
-[type: gettext/glade]data/eog-preferences-dialog.ui
-[type: gettext/glade]data/eog-zoom-entry.ui
-[type: gettext/glade]data/fullscreen-toolbar.ui
-[type: gettext/glade]data/help-overlay.ui
-[type: gettext/glade]data/metadata-sidebar.ui
-[type: gettext/gsettings]data/org.gnome.eog.gschema.xml.in
-[type: gettext/glade]data/popup-menus.ui
+data/eog-gear-menu.ui
+data/eog-image-properties-dialog.ui
+data/eog-multiple-save-as-dialog.ui
+data/eog-preferences-dialog.ui
+data/eog-zoom-entry.ui
+data/fullscreen-toolbar.ui
+data/help-overlay.ui
+data/metadata-sidebar.ui
+data/org.gnome.eog.gschema.xml.in
+data/popup-menus.ui
 plugins/fullscreen/eog-fullscreen-plugin.c
 plugins/fullscreen/fullscreen.plugin.desktop.in
 plugins/reload/eog-reload-plugin.c
diff --git a/src/eog.gresource.xml b/src/eog.gresource.xml
index 79f8071..ea9b0a1 100644
--- a/src/eog.gresource.xml
+++ b/src/eog.gresource.xml
@@ -13,7 +13,7 @@
     <file compressed="true" preprocess="xml-stripblanks">popup-menus.ui</file>
   </gresource>
   <gresource prefix="/org/gnome/eog/gtk">
-    <file alias="menus.ui" compressed="true" preprocess="xml-stripblanks">eog-app-menu.xml</file>
+    <file alias="menus.ui" compressed="true" preprocess="xml-stripblanks">eog-app-menu.ui</file>
     <file compressed="true" preprocess="xml-stripblanks">help-overlay.ui</file>
   </gresource>
 </gresources>


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