[seahorse] Migrate from intltool to gettext



commit e74199a117fe5ab31a910bf93667ae9ff792612e
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Sep 17 11:43:03 2017 +0200

    Migrate from intltool to gettext

 Makefile.am                  |   10 +-----
 Makefile.decl                |    4 +--
 configure.ac                 |    4 +-
 data/Makefile.am             |    6 ++-
 data/seahorse.appdata.xml.in |   12 +++---
 data/seahorse.desktop.in.in  |    6 ++--
 po/Makevars                  |   78 ++++++++++++++++++++++++++++++++++++++++++
 po/POTFILES.in               |   76 ++++++++++++++++++++--------------------
 8 files changed, 133 insertions(+), 63 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index e99e447..ba9527b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,21 +21,13 @@ EXTRA_DIST = \
     NEWS \
     README \
     THANKS \
-    TODO \
-    intltool-extract.in \
-    intltool-merge.in \
-    intltool-update.in
+    TODO
 
 MAINTAINERCLEANFILES = \
        $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
        $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN) \
        $(GITIGNORE_MAINTAINERCLEANFILES_M4_LIBTOOL)
 
-DISTCLEANFILES = \
-    intltool-extract \
-    intltool-merge \
-    intltool-update
-
 DISTCHECK_CONFIGURE_FLAGS = \
     --disable-scrollkeeper \
     --disable-update-mime-database \
diff --git a/Makefile.decl b/Makefile.decl
index e086f0d..1a160b5 100644
--- a/Makefile.decl
+++ b/Makefile.decl
@@ -22,9 +22,7 @@ SED_SUBST = sed \
 .desktop.in.in.desktop.in:
        $(V_SED) $(SED_SUBST) $< > $@
 
-@INTLTOOL_DESKTOP_RULE@
-
 .service.in.service:
        $(V_SED) $(SED_SUBST) $< > $@
 
-SUFFIXES = .desktop.in .desktop.in.in .service .service.in
\ No newline at end of file
+SUFFIXES = .desktop.in .desktop.in.in .service .service.in
diff --git a/configure.ac b/configure.ac
index 723b46f..7789ef4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -28,10 +28,11 @@ AC_CONFIG_MACRO_DIR([build/m4])
 AC_PROG_CC
 AC_PROG_CXX
 AM_PROG_CC_C_O
-AC_PROG_INTLTOOL([0.35.0])
 AC_PROG_RANLIB
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
 GETTEXT_PACKAGE=seahorse
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext domain.])
@@ -96,7 +97,6 @@ AC_SUBST(GLIB_COMPILE_RESOURCES)
 YELP_HELP_INIT
 
 GLIB_GSETTINGS
-AM_GLIB_GNU_GETTEXT
 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
 
 PKG_CHECK_MODULES(EGG, gtk+-3.0 >= $GTK_REQ)
diff --git a/data/Makefile.am b/data/Makefile.am
index 91fe30d..af1b79d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -23,12 +23,14 @@ service_in_files =                          \
 appdatadir = $(datadir)/appdata
 appdata_in_files = seahorse.appdata.xml.in
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
-@INTLTOOL_XML_RULE@
+$(appdata_DATA): $(appdata_in_files)
+       $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 desktopdir = $(datadir)/applications
 desktop_in_files = seahorse.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-@INTLTOOL_DESKTOP_RULE@
+$(desktop_DATA): $(desktop_in_files)
+       $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 searchproviderdir = $(datadir)/gnome-shell/search-providers
 dist_searchprovider_DATA = seahorse-search-provider.ini
diff --git a/data/seahorse.appdata.xml.in b/data/seahorse.appdata.xml.in
index 68bbbbf..c85e5c7 100644
--- a/data/seahorse.appdata.xml.in
+++ b/data/seahorse.appdata.xml.in
@@ -3,18 +3,18 @@
   <id>seahorse.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+ and LGPL-2.0+</project_license>
-  <_name>Seahorse</_name>
-  <_summary>Manage your passwords and encryption keys</_summary>
+  <name>Seahorse</name>
+  <summary>Manage your passwords and encryption keys</summary>
   <description>
-    <_p>
+    <p>
       Seahorse is a GNOME application for managing encryption keys.
       It also integrates with nautilus, gedit and other places for encryption operations.
-    </_p>
-    <_p>
+    </p>
+    <p>
       With seahorse you can create and manage PGP keys, create and manage SSH keys,
       publish and retrieve keys from key servers, cache your passphrase so you
       don’t have to keep typing it and backup your keys and keyring.
-    </_p>
+    </p>
   </description>
 
   <!--
diff --git a/data/seahorse.desktop.in.in b/data/seahorse.desktop.in.in
index d3ba30c..2bc76d7 100644
--- a/data/seahorse.desktop.in.in
+++ b/data/seahorse.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
-_Name=Passwords and Keys
-_Comment=Manage your passwords and encryption keys
-_Keywords=keyring;encryption;security;sign;ssh;
+Name=Passwords and Keys
+Comment=Manage your passwords and encryption keys
+Keywords=keyring;encryption;security;sign;ssh;
 Exec=@bindir@/seahorse
 Terminal=false
 Type=Application
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..dd6525e
--- /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
+
+# 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 = Seahorse 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 = 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 =
+
+# 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 = no
+
+# 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 470bcf3..357ef6e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,10 +1,10 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-data/seahorse.appdata.xml.in
-data/seahorse.desktop.in.in
 common/catalog.vala
 common/exportable.vala
 common/util.vala
+data/seahorse.appdata.xml.in
+data/seahorse.desktop.in.in
 gkr/gkr-backend.vala
 gkr/gkr-item-add.vala
 gkr/gkr-item-properties.vala
@@ -12,85 +12,85 @@ gkr/gkr-item.vala
 gkr/gkr-keyring-add.vala
 gkr/gkr-keyring-properties.vala
 gkr/gkr-keyring.vala
-[type: gettext/glade]gkr/seahorse-add-keyring.xml
-[type: gettext/glade]gkr/seahorse-gkr-add-item.xml
-[type: gettext/glade]gkr/seahorse-gkr-item-properties.xml
-[type: gettext/glade]gkr/seahorse-gkr-keyring.xml
+gkr/seahorse-add-keyring.xml
+gkr/seahorse-gkr-add-item.xml
+gkr/seahorse-gkr-item-properties.xml
+gkr/seahorse-gkr-keyring.xml
 libegg/egg-datetime.c
-[type: gettext/glade]libseahorse/seahorse-add-keyserver.xml
+libseahorse/seahorse-add-keyserver.xml
 libseahorse/seahorse-application.c
 libseahorse/seahorse-interaction.c
 libseahorse/seahorse-key-manager-store.c
 libseahorse/seahorse-object.c
 libseahorse/seahorse-passphrase.c
 libseahorse/seahorse-prefs.c
-[type: gettext/glade]libseahorse/seahorse-prefs.xml
-[type: gettext/glade]libseahorse/seahorse-progress.xml
+libseahorse/seahorse-prefs.xml
+libseahorse/seahorse-progress.xml
 libseahorse/seahorse-search-provider.c
 libseahorse/seahorse-util.c
 libseahorse/seahorse-validity.c
 libseahorse/seahorse-widget.c
-[type: gettext/glade]pgp/seahorse-add-subkey.xml
-[type: gettext/glade]pgp/seahorse-add-uid.xml
-[type: gettext/glade]pgp/seahorse-expires.xml
+pgp/seahorse-add-subkey.xml
+pgp/seahorse-add-uid.xml
+pgp/seahorse-expires.xml
+pgp/seahorse-gpg-options.c
 pgp/seahorse-gpgme-add-subkey.c
 pgp/seahorse-gpgme-add-uid.c
-pgp/seahorse-gpgme.c
 pgp/seahorse-gpgme-expires.c
 pgp/seahorse-gpgme-exporter.c
 pgp/seahorse-gpgme-generate.c
-pgp/seahorse-gpgme-key.c
 pgp/seahorse-gpgme-key-deleter.c
 pgp/seahorse-gpgme-key-op.c
+pgp/seahorse-gpgme-key.c
 pgp/seahorse-gpgme-keyring.c
 pgp/seahorse-gpgme-photos.c
 pgp/seahorse-gpgme-revoke.c
 pgp/seahorse-gpgme-secret-deleter.c
 pgp/seahorse-gpgme-sign.c
 pgp/seahorse-gpgme-subkey.c
-pgp/seahorse-gpg-options.c
+pgp/seahorse-gpgme.c
 pgp/seahorse-hkp-source.c
 pgp/seahorse-keyserver-results.c
-[type: gettext/glade]pgp/seahorse-keyserver-results.xml
+pgp/seahorse-keyserver-results.xml
 pgp/seahorse-keyserver-search.c
-[type: gettext/glade]pgp/seahorse-keyserver-search.xml
+pgp/seahorse-keyserver-search.xml
 pgp/seahorse-keyserver-sync.c
-[type: gettext/glade]pgp/seahorse-keyserver-sync.xml
+pgp/seahorse-keyserver-sync.xml
 pgp/seahorse-ldap-source.c
 pgp/seahorse-pgp-actions.c
 pgp/seahorse-pgp-backend.c
-[type: gettext/glade]pgp/seahorse-pgp-generate.xml
-pgp/seahorse-pgp-key.c
+pgp/seahorse-pgp-generate.xml
 pgp/seahorse-pgp-key-properties.c
-[type: gettext/glade]pgp/seahorse-pgp-private-key-properties.xml
-[type: gettext/glade]pgp/seahorse-pgp-public-key-properties.xml
+pgp/seahorse-pgp-key.c
+pgp/seahorse-pgp-private-key-properties.xml
+pgp/seahorse-pgp-public-key-properties.xml
 pgp/seahorse-pgp-subkey.c
-[type: gettext/glade]pgp/seahorse-revoke.xml
+pgp/seahorse-revoke.xml
 pgp/seahorse-server-source.c
+pgp/seahorse-sign.xml
 pgp/seahorse-signer.c
-[type: gettext/glade]pgp/seahorse-signer.xml
-[type: gettext/glade]pgp/seahorse-sign.xml
+pgp/seahorse-signer.xml
 pgp/seahorse-transfer.c
-pgp/seahorse-unknown.c
 pgp/seahorse-unknown-source.c
+pgp/seahorse-unknown.c
 pkcs11/certificate-der-exporter.vala
 pkcs11/pkcs11-certificate.vala
-pkcs11/seahorse-pkcs11-backend.c
 pkcs11/pkcs11-deleter.vala
-pkcs11/seahorse-pkcs11-generate.c
-[type: gettext/glade]pkcs11/seahorse-pkcs11-generate.xml
 pkcs11/pkcs11-key-deleter.vala
+pkcs11/pkcs11-private-key.vala
 pkcs11/pkcs11-properties.vala
 pkcs11/pkcs11-request.vala
-[type: gettext/glade]pkcs11/seahorse-pkcs11-request.xml
-pkcs11/pkcs11-private-key.vala
 pkcs11/pkcs11-token.vala
-[type: gettext/glade]src/seahorse-change-passphrase.xml
+pkcs11/seahorse-pkcs11-backend.c
+pkcs11/seahorse-pkcs11-generate.c
+pkcs11/seahorse-pkcs11-generate.xml
+pkcs11/seahorse-pkcs11-request.xml
+src/seahorse-change-passphrase.xml
 src/seahorse-generate-select.c
-[type: gettext/glade]src/seahorse-generate-select.xml
+src/seahorse-generate-select.xml
 src/seahorse-import-dialog.c
 src/seahorse-key-manager.c
-[type: gettext/glade]src/seahorse-key-manager.xml
+src/seahorse-key-manager.xml
 src/seahorse-main.c
 src/seahorse-sidebar.c
 ssh/seahorse-ssh-actions.c
@@ -99,11 +99,11 @@ ssh/seahorse-ssh-backend.c
 ssh/seahorse-ssh-deleter.c
 ssh/seahorse-ssh-exporter.c
 ssh/seahorse-ssh-generate.c
-[type: gettext/glade]ssh/seahorse-ssh-generate.xml
-ssh/seahorse-ssh-key.c
+ssh/seahorse-ssh-generate.xml
 ssh/seahorse-ssh-key-properties.c
-[type: gettext/glade]ssh/seahorse-ssh-key-properties.xml
+ssh/seahorse-ssh-key-properties.xml
+ssh/seahorse-ssh-key.c
 ssh/seahorse-ssh-operation.c
 ssh/seahorse-ssh-source.c
 ssh/seahorse-ssh-upload.c
-[type: gettext/glade]ssh/seahorse-ssh-upload.xml
+ssh/seahorse-ssh-upload.xml


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