[gnome-multi-writer/wip/hughsie/no-intltool] Port away from intltool



commit d0d6b05e73e3ef8980a66ca420ccb114084197ee
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 6 16:01:55 2016 +0000

    Port away from intltool

 autogen.sh                                        |    2 +-
 configure.ac                                      |    4 +-
 contrib/gnome-multi-writer.spec.in                |    1 -
 data/Makefile.am                                  |    8 ++-
 data/appdata/Makefile.am                          |    4 +-
 data/appdata/org.gnome.MultiWriter.appdata.xml.in |   30 ++++----
 data/org.gnome.MultiWriter.desktop.in             |    6 +-
 data/org.gnome.MultiWriter.policy.in              |    4 +-
 po/.gitignore                                     |    9 +--
 po/Makevars                                       |   78 +++++++++++++++++++++
 po/POTFILES.in                                    |    5 +-
 11 files changed, 115 insertions(+), 36 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 21f4027..39da74e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -23,4 +23,4 @@ which gnome-autogen.sh || {
     exit 1
 }
 
-REQUIRED_AUTOMAKE_VERSION=1.7 GNOME_DATADIR="$gnome_datadir" USE_GNOME2_MACROS=1 . gnome-autogen.sh
+REQUIRED_AUTOMAKE_VERSION=1.7 GNOME_DATADIR="$gnome_datadir" . gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
index d183878..4abedff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,16 +17,16 @@ AC_PROG_INSTALL
 AC_OBJEXT
 LT_INIT
 AM_PROG_CC_C_O
-IT_PROG_INTLTOOL([0.50.0])
 GLIB_GSETTINGS
 
 dnl ---------------------------------------------------------------------------
 dnl - gettext stuff
 dnl ---------------------------------------------------------------------------
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.7])
 GETTEXT_PACKAGE=AC_PACKAGE_NAME
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE(GETTEXT_PACKAGE, "AC_PACKAGE_NAME", [foo])
-AM_GLIB_GNU_GETTEXT
 
 WARN_CFLAGS_EXTRA="
        -Waggregate-return
diff --git a/contrib/gnome-multi-writer.spec.in b/contrib/gnome-multi-writer.spec.in
index c5046aa..28e7443 100644
--- a/contrib/gnome-multi-writer.spec.in
+++ b/contrib/gnome-multi-writer.spec.in
@@ -13,7 +13,6 @@ BuildRequires: docbook-utils
 BuildRequires: gettext
 BuildRequires: glib2-devel
 BuildRequires: gtk3-devel
-BuildRequires: intltool
 BuildRequires: itstool
 BuildRequires: libcanberra-devel >= 0.10
 BuildRequires: libgusb-devel >= 0.2.4
diff --git a/data/Makefile.am b/data/Makefile.am
index 71f67ad..b3c2e43 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,7 +2,9 @@ SUBDIRS =                                               \
        appdata                                         \
        icons
 
-@INTLTOOL_DESKTOP_RULE@
+%.desktop: %.desktop.in
+       $(AM_V_GEN) msgfmt --desktop -d $(top_srcdir)/po --template $< -o $@
+
 desktopdir = $(datadir)/applications
 desktop_in_files =                                     \
        org.gnome.MultiWriter.desktop.in
@@ -11,7 +13,9 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
 @GSETTINGS_RULES@
 gsettings_SCHEMAS = org.gnome.MultiWriter.gschema.xml
 
-@INTLTOOL_POLICY_RULE@
+%.policy: %.policy.in
+       $(AM_V_GEN) msgfmt --xml -d $(top_srcdir)/po --template $< -o $@
+
 polkit_policydir = $(datadir)/polkit-1/actions
 polkit_policy_DATA =                                   \
        org.gnome.MultiWriter.policy
diff --git a/data/appdata/Makefile.am b/data/appdata/Makefile.am
index e5fa090..c02e9a2 100644
--- a/data/appdata/Makefile.am
+++ b/data/appdata/Makefile.am
@@ -1,4 +1,6 @@
-@INTLTOOL_XML_RULE@
+%.appdata.xml: %.appdata.xml.in
+       $(AM_V_GEN) msgfmt --xml -d $(top_srcdir)/po --template $< -o $@
+
 appdatadir = $(datadir)/appdata
 appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files =                                             \
diff --git a/data/appdata/org.gnome.MultiWriter.appdata.xml.in 
b/data/appdata/org.gnome.MultiWriter.appdata.xml.in
index 6909879..d68e93d 100644
--- a/data/appdata/org.gnome.MultiWriter.appdata.xml.in
+++ b/data/appdata/org.gnome.MultiWriter.appdata.xml.in
@@ -5,56 +5,56 @@
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+</project_license>
   <!-- TRANSLATORS: the application name -->
-  <_name>MultiWriter</_name>
+  <name>MultiWriter</name>
   <!-- TRANSLATORS: one-line description for the app -->
-  <_summary>Write an ISO file to multiple USB devices at once</_summary>
+  <summary>Write an ISO file to multiple USB devices at once</summary>
   <description>
     <!-- TRANSLATORS: AppData description marketing paragraph -->
-    <_p>
+    <p>
       GNOME MultiWriter can be used to write an ISO file to multiple USB devices
       at once.
       Supported drive sizes are between 1GB and 32GB.
-    </_p>
+    </p>
     <!-- TRANSLATORS: QA refers to quality assurance, aka people testing stuff,
                       GNOME refers to the desktop environment -->
-    <_p>
+    <p>
       MultiWriter may be useful for QA testing, to create a GNOME Live image
       for a code sprint or to create hundreds of LiveUSB drives for a trade
       show.
-    </_p>
+    </p>
     <!-- TRANSLATORS: saturate as in the throughput can get no more -->
-    <_p>
+    <p>
       Writing a more than 10 devices simultaneously can easy saturate the USB
       bus for most storage devices.
       There are two ways to write more devices in parallel:
-    </_p>
+    </p>
     <ul>
       <!-- TRANSLATORS: storage devices refers to the things we're writing to -->
-      <_li>Use USB 3.0 hubs, even if the storage devices are USB 2.0</_li>
+      <li>Use USB 3.0 hubs, even if the storage devices are USB 2.0</li>
       <!-- TRANSLATORS: PCIe is the data bus, don't translate please -->
-      <_li>Install another USB 2.0 PCIe root hub</_li>
+      <li>Install another USB 2.0 PCIe root hub</li>
     </ul>
     <!-- TRANSLATORS: the ColorHug is an open hardware product, don't translate the name -->
-    <_p>
+    <p>
       MultiWriter was originally written as part of the ColorHug project but
       was split off as an independent application in 2015.
-    </_p>
+    </p>
   </description>
   <screenshots>
     <screenshot type="default">
       <image>https://git.gnome.org/browse/gnome-multi-writer/plain/data/appdata/gmw-startup.png</image>
       <!-- TRANSLATORS: the 1st screenshot caption -->
-      <_caption>Initial screen for the application</_caption>
+      <caption>Initial screen for the application</caption>
     </screenshot>
     <screenshot>
       <image>https://git.gnome.org/browse/gnome-multi-writer/plain/data/appdata/gmw-progress.png</image>
       <!-- TRANSLATORS: the 2nd screenshot caption -->
-      <_caption>Writing and verifying images</_caption>
+      <caption>Writing and verifying images</caption>
     </screenshot>
     <screenshot>
       <image>https://git.gnome.org/browse/gnome-multi-writer/plain/data/appdata/gmw-finished.png</image>
       <!-- TRANSLATORS: the 3rd screenshot caption -->
-      <_caption>All devices have been written</_caption>
+      <caption>All devices have been written</caption>
     </screenshot>
   </screenshots>
   <!--
diff --git a/data/org.gnome.MultiWriter.desktop.in b/data/org.gnome.MultiWriter.desktop.in
index 3c6b1d5..456e739 100644
--- a/data/org.gnome.MultiWriter.desktop.in
+++ b/data/org.gnome.MultiWriter.desktop.in
@@ -1,12 +1,12 @@
 [Desktop Entry]
-_Name=MultiWriter
-_Comment=Write an ISO file to multiple USB devices at once
+Name=MultiWriter
+Comment=Write an ISO file to multiple USB devices at once
 Icon=gnome-multi-writer
 Exec=gnome-multi-writer
 Terminal=false
 Type=Application
 Categories=GNOME;GTK;System;
 # TRANSLATORS: these are desktop keywords - remember the trailing ';' :)
-_Keywords=Image;Writer;ISO;USB;
+Keywords=Image;Writer;ISO;USB;
 StartupNotify=true
 NoDisplay=false
diff --git a/data/org.gnome.MultiWriter.policy.in b/data/org.gnome.MultiWriter.policy.in
index 6d96e58..d13e57d 100644
--- a/data/org.gnome.MultiWriter.policy.in
+++ b/data/org.gnome.MultiWriter.policy.in
@@ -14,8 +14,8 @@
   <icon_name>gnome-multi-writer</icon_name>
 
   <action id="org.gnome.MultiWriter.probe">
-    <_description>Check the device</_description>
-    <_message>Authentication is required to probe the device</_message>
+    <description>Check the device</description>
+    <message>Authentication is required to probe the device</message>
     <icon_name>drive-harddisk-usb</icon_name>
     <defaults>
       <allow_any>auth_admin</allow_any>
diff --git a/po/.gitignore b/po/.gitignore
index ef704bd..985bb61 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -1,11 +1,8 @@
 *.header
-.intltool-merge-cache
-Makefile.in.in
-Makefile.in.in~
 Makevars.template
-*.pot
-POTFILES
 Rules-quot
 *.sed
 *.sin
-stamp-it
+*.po~
+Makefile.in.in~
+stamp-po
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..55b76d7
--- /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 = Richard Hughes
+
+# 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 = richard hughsie com
+
+# 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 = --no-location --no-wrap
+
+# 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 = --no-wrap
+
+# 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 = yes
+
+# 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 2aa7188..64f136d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
-[encoding: UTF-8]
-[type: gettext/glade]data/gmw-main.ui
-[type: gettext/glade]data/gmw-menus.ui
+data/gmw-main.ui
+data/gmw-menus.ui
 data/appdata/org.gnome.MultiWriter.appdata.xml.in
 data/org.gnome.MultiWriter.gschema.xml
 data/org.gnome.MultiWriter.desktop.in


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