[seahorse-nautilus] Migrate from intltool to GNU gettext.



commit 1d907e9018176c953797ad5f44c072dbf05d3bcb
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sat Dec 2 13:45:04 2017 +0100

    Migrate from intltool to GNU gettext.

 Makefile.am                                        |    9 +--
 configure.ac                                       |    8 ++-
 po/Makevars                                        |   78 ++++++++++++++++++++
 po/POTFILES.in                                     |    6 +-
 tool/Makefile.am                                   |    9 +-
 ...multi-encrypt.xml => seahorse-multi-encrypt.ui} |    0
 tool/{seahorse-notify.xml => seahorse-notify.ui}   |    0
 tool/seahorse-pgp-encrypted.desktop.in.in          |    2 +-
 tool/seahorse-pgp-keys.desktop.in.in               |    2 +-
 tool/seahorse-pgp-signature.desktop.in.in          |    2 +-
 ...{seahorse-progress.xml => seahorse-progress.ui} |    0
 tool/seahorse-widget.c                             |    4 +-
 12 files changed, 98 insertions(+), 22 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 4eccb91..f3e0ac9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,15 +14,8 @@ EXTRA_DIST = \
        MAINTAINERS \
        NEWS \
        README \
-       THANKS \
-       intltool-extract.in \
-       intltool-merge.in \
-       intltool-update.in
+       THANKS
 
-DISTCLEANFILES = \
-       intltool-extract \
-       intltool-merge \
-       intltool-update
 
 DISTCHECK_CONFIGURE_FLAGS = \
        --with-nautilus-ext-dir=/tmp
diff --git a/configure.ac b/configure.ac
index 1bb307e..6083d0d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,13 +25,18 @@ AC_PROG_LN_S
 AC_PROG_MAKE_SET
 AM_DISABLE_STATIC
 AM_PROG_LIBTOOL
-IT_PROG_INTLTOOL([0.35.0])
 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
 
 AC_SYS_LARGEFILE
 AC_TYPE_OFF_T
 AC_FUNC_FSEEKO
 
+# -----------------------------------------------------------------------------
+# i18n
+
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
+
 GETTEXT_PACKAGE=seahorse-nautilus
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext domain.])
@@ -40,7 +45,6 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext dom
 # GLib and GTK+ stuff
 
 GLIB_GSETTINGS
-AM_GLIB_GNU_GETTEXT
 
 PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.0 gio-2.0)
 
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..a251e8f
--- /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 --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 = 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 = 
https://bugzilla.gnome.org/enter_bug.cgi?product=seahorse-plugins&keywords=I18N+L10N&component=general
+
+# 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 9a7946d..ffa7874 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -3,14 +3,14 @@
 data/org.gnome.seahorse.nautilus.gschema.xml
 data/org.gnome.seahorse.nautilus.window.gschema.xml
 nautilus-ext/seahorse-nautilus.c
-[type: gettext/glade]tool/seahorse-multi-encrypt.xml
+tool/seahorse-multi-encrypt.ui
 tool/seahorse-notification.c
-[type: gettext/glade]tool/seahorse-notify.xml
+tool/seahorse-notify.ui
 tool/seahorse-passphrase.c
 tool/seahorse-pgp-encrypted.desktop.in.in
 tool/seahorse-pgp-keys.desktop.in.in
 tool/seahorse-pgp-signature.desktop.in.in
-[type: gettext/glade]tool/seahorse-progress.xml
+tool/seahorse-progress.ui
 tool/seahorse-tool.c
 tool/seahorse-tool-files.c
 tool/seahorse-util.c
diff --git a/tool/Makefile.am b/tool/Makefile.am
index 50986d9..e59a694 100644
--- a/tool/Makefile.am
+++ b/tool/Makefile.am
@@ -39,21 +39,22 @@ seahorse-marshal.c: seahorse-marshal.list $(GLIB_GENMARSHAL)
        $(GLIB_GENMARSHAL) $< --body --prefix=seahorse_marshal >> $@
 
 ui_DATA = \
-       seahorse-notify.xml \
-       seahorse-progress.xml \
-       seahorse-multi-encrypt.xml
+       seahorse-notify.ui \
+       seahorse-progress.ui \
+       seahorse-multi-encrypt.ui
 
 seahorse_tool_LDADD = \
        $(SEAHORSE_LIBS) \
        $(LIBCRYPTUI_LIBS)
 
-@INTLTOOL_DESKTOP_RULE@
 desktopdir = $(datadir)/applications
 desktop_in_files = \
        seahorse-pgp-encrypted.desktop.in \
        seahorse-pgp-signature.desktop.in \
        seahorse-pgp-keys.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+$(desktop_DATA): $(desktop_in_files)
+       $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 man_MANS = seahorse-tool.1
 
diff --git a/tool/seahorse-multi-encrypt.xml b/tool/seahorse-multi-encrypt.ui
similarity index 100%
rename from tool/seahorse-multi-encrypt.xml
rename to tool/seahorse-multi-encrypt.ui
diff --git a/tool/seahorse-notify.xml b/tool/seahorse-notify.ui
similarity index 100%
rename from tool/seahorse-notify.xml
rename to tool/seahorse-notify.ui
diff --git a/tool/seahorse-pgp-encrypted.desktop.in.in b/tool/seahorse-pgp-encrypted.desktop.in.in
index 0897aa0..573f1c0 100644
--- a/tool/seahorse-pgp-encrypted.desktop.in.in
+++ b/tool/seahorse-pgp-encrypted.desktop.in.in
@@ -1,5 +1,5 @@
 [Desktop Entry]
-_Name=Decrypt File
+Name=Decrypt File
 MimeType=application/pgp-encrypted;
 Exec=seahorse-tool --decrypt %U
 Type=Application
diff --git a/tool/seahorse-pgp-keys.desktop.in.in b/tool/seahorse-pgp-keys.desktop.in.in
index 5b4bd73..e7e36da 100644
--- a/tool/seahorse-pgp-keys.desktop.in.in
+++ b/tool/seahorse-pgp-keys.desktop.in.in
@@ -1,5 +1,5 @@
 [Desktop Entry]
-_Name=Import Key
+Name=Import Key
 MimeType=application/pgp-keys;
 Exec=seahorse-tool --import %U
 Type=Application
diff --git a/tool/seahorse-pgp-signature.desktop.in.in b/tool/seahorse-pgp-signature.desktop.in.in
index 77820f7..40cf5db 100644
--- a/tool/seahorse-pgp-signature.desktop.in.in
+++ b/tool/seahorse-pgp-signature.desktop.in.in
@@ -1,5 +1,5 @@
 [Desktop Entry]
-_Name=Verify Signature
+Name=Verify Signature
 MimeType=application/pgp-signature;
 Exec=seahorse-tool --verify %U
 Type=Application
diff --git a/tool/seahorse-progress.xml b/tool/seahorse-progress.ui
similarity index 100%
rename from tool/seahorse-progress.xml
rename to tool/seahorse-progress.ui
diff --git a/tool/seahorse-widget.c b/tool/seahorse-widget.c
index bb75c0e..57e0117 100644
--- a/tool/seahorse-widget.c
+++ b/tool/seahorse-widget.c
@@ -203,7 +203,7 @@ object_set_property (GObject *object, guint prop_id, const GValue *value, GParam
     case PROP_NAME:
         g_return_if_fail (swidget->name == NULL);
         swidget->name = g_value_dup_string (value);
-        path = g_strdup_printf ("%sseahorse-%s.xml",
+        path = g_strdup_printf ("%sseahorse-%s.ui",
                                 SEAHORSE_UIDIR, swidget->name);
         swidget->gtkbuilder = gtk_builder_new ();
         gtk_builder_add_from_file (swidget->gtkbuilder, path, &error);
@@ -345,7 +345,7 @@ seahorse_widget_get_widget (SeahorseWidget *swidget, const char *identifier)
 {
     GtkWidget *widget = GTK_WIDGET (gtk_builder_get_object (swidget->gtkbuilder, identifier));
     if (widget == NULL)
-           g_warning ("could not find widget %s for seahorse-%s.xml", identifier, swidget->name);
+           g_warning ("could not find widget %s for seahorse-%s.ui", identifier, swidget->name);
     return widget;
 }
 


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