[gnome-power-manager] Port away from intltool



commit 88678b7b054fc7007fc023ffc118364e79b681be
Author: Richard Hughes <richard hughsie com>
Date:   Tue Dec 6 15:44:01 2016 +0000

    Port away from intltool

 Makefile.am                                      |   10 +--
 configure.ac                                     |    5 +-
 contrib/gnome-power-manager.spec.in              |    1 -
 data/Makefile.am                                 |    4 +-
 data/appdata/Makefile.am                         |    4 +-
 data/appdata/org.gnome.PowerStats.appdata.xml.in |   12 ++--
 data/org.gnome.PowerStats.desktop.in.in          |    6 +-
 po/.gitignore                                    |   16 ++--
 po/Makevars                                      |   78 ++++++++++++++++++++++
 po/POTFILES.in                                   |    5 +-
 10 files changed, 107 insertions(+), 34 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 37f235e..9e537f5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,22 +8,18 @@ SUBDIRS =                                             \
        data
 
 EXTRA_DIST =                                           \
-       MAINTAINERS                                     \
-       intltool-extract.in                             \
-       intltool-merge.in                               \
-       intltool-update.in
+       MAINTAINERS
 
 DISTCLEANFILES =                                       \
-       intltool-extract                                \
-       intltool-merge                                  \
-       intltool-update                                 \
        test-driver                                     \
        gnome-power-manager-*.tar.*
 
 MAINTAINERCLEANFILES =                                 \
+       ABOUT-NLS                                       \
        aclocal.m4                                      \
        compile                                         \
        config.guess                                    \
+       config.rpath                                    \
        config.h.in                                     \
        config.sub                                      \
        depcomp                                         \
diff --git a/configure.ac b/configure.ac
index f7161ae..acfa743 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,6 @@ AM_PROG_CC_C_O
 
 AC_PROG_INSTALL
 LT_INIT
-IT_PROG_INTLTOOL([0.50.0])
 
 GNOME_COMPILE_WARNINGS
 
@@ -77,11 +76,11 @@ CPPFLAGS="$CPPFLAGS -fexceptions"
 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
 GLIB_GSETTINGS
 
 dnl ---------------------------------------------------------------------------
diff --git a/contrib/gnome-power-manager.spec.in b/contrib/gnome-power-manager.spec.in
index 8ec317e..3d9a46e 100644
--- a/contrib/gnome-power-manager.spec.in
+++ b/contrib/gnome-power-manager.spec.in
@@ -14,7 +14,6 @@ BuildRequires: gettext
 BuildRequires: libtool
 BuildRequires: cairo-devel
 BuildRequires: upower-devel >= 0.9.0
-BuildRequires: intltool
 BuildRequires: glib2-devel >= 2.25.9
 BuildRequires: gtk3-devel >= 2.91.3
 BuildRequires: docbook-utils
diff --git a/data/Makefile.am b/data/Makefile.am
index 9928dc7..81f1d28 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,8 @@
 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.PowerStats.desktop.in
 desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
diff --git a/data/appdata/Makefile.am b/data/appdata/Makefile.am
index b97f7cd..4984832 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 = org.gnome.PowerStats.appdata.xml.in
diff --git a/data/appdata/org.gnome.PowerStats.appdata.xml.in 
b/data/appdata/org.gnome.PowerStats.appdata.xml.in
index 3b44be7..185fbc4 100644
--- a/data/appdata/org.gnome.PowerStats.appdata.xml.in
+++ b/data/appdata/org.gnome.PowerStats.appdata.xml.in
@@ -4,18 +4,18 @@
   <id>org.gnome.PowerStats.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+ and GFDL-1.3</project_license>
-  <_name>GNOME Power Statistics</_name>
-  <_summary>Observe power management</_summary>
+  <name>GNOME Power Statistics</name>
+  <summary>Observe power management</summary>
   <description>
-    <_p>
+    <p>
       Power Statistics can show historical and current battery information and
       programs waking up that use power.
-    </_p>
-    <_p>
+    </p>
+    <p>
       You probably only need to install this application if you are having
       problems with your laptop battery, or are trying to work out what programs
       are using significant amounts of power.
-    </_p>
+    </p>
   </description>
   <screenshots>
     <screenshot type="default">
diff --git a/data/org.gnome.PowerStats.desktop.in.in b/data/org.gnome.PowerStats.desktop.in.in
index d0eacf4..5455565 100644
--- a/data/org.gnome.PowerStats.desktop.in.in
+++ b/data/org.gnome.PowerStats.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
-_Name=Power Statistics
-_Comment=Observe power management
-_Keywords=battery;consumption;charge;
+Name=Power Statistics
+Comment=Observe power management
+Keywords=battery;consumption;charge;
 Icon=org.gnome.PowerStats
 Exec=gnome-power-statistics
 Terminal=false
diff --git a/po/.gitignore b/po/.gitignore
index 13c3341..985bb61 100644
--- a/po/.gitignore
+++ b/po/.gitignore
@@ -1,8 +1,8 @@
-*.gmo
-*.pot
-.intltool-merge-cache
-Makefile.in
-Makefile.in.in
-POTFILES
-stamp-it
-
+*.header
+Makevars.template
+Rules-quot
+*.sed
+*.sin
+*.po~
+Makefile.in.in~
+stamp-po
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..0dfd398
--- /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 = 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 b463ac6..fe76c18 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,9 +1,6 @@
-[encoding: UTF-8]
-# List of source files containing translatable strings.
-# Please keep this file sorted alphabetically.
 data/appdata/org.gnome.PowerStats.appdata.xml.in
 data/org.gnome.power-manager.gschema.xml
 data/org.gnome.PowerStats.desktop.in.in
 src/egg-graph-widget.c
 src/gpm-statistics.c
-[type: gettext/glade]src/gpm-statistics.ui
+src/gpm-statistics.ui


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