[gnome-music] Migrate from intltool to gettext



commit ed563c2c58739dd38868f8cb33ff41f9c683af90
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Tue Sep 5 00:15:25 2017 +0200

    Migrate from intltool to gettext
    
    Signed-off-by: Niels De Graef <nielsdegraef gmail com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787272

 .gitignore                          |    6 +--
 configure.ac                        |    3 +-
 data/Makefile.am                    |   13 +++---
 data/org.gnome.Music.appdata.xml.in |    8 ++--
 data/org.gnome.Music.desktop.in     |    8 ++--
 po/Makevars                         |   78 +++++++++++++++++++++++++++++++++++
 po/POTFILES.in                      |   25 +++++------
 7 files changed, 109 insertions(+), 32 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 6dd0d18..2c30220 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@ libgd/
 /.gitignore
 /.libs
 /AUTHORS
+/ABOUT-NLS
 /GPATH
 /GRTAGS
 /GSYMS
@@ -33,6 +34,7 @@ libgd/
 /config.h.in
 /config.log
 /config.lt
+/config.rpath
 /config.status
 /config.status.lineno
 /config.sub
@@ -41,9 +43,6 @@ libgd/
 /configure.scan
 /depcomp
 /install-sh
-/intltool-extract.in
-/intltool-merge.in
-/intltool-update.in
 /libtool
 /ltmain.sh
 /m4
@@ -51,7 +50,6 @@ libgd/
 /mkinstalldirs
 /po/*.gmo
 /po/*.mo
-/po/.intltool-merge-cache
 /po/Makefile
 /po/Makefile.in
 /po/Makefile.in.in
diff --git a/configure.ac b/configure.ac
index ac91582..281c2d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,11 +13,12 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
 
 AM_PATH_PYTHON([3.3])
 
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.19.8])
 GETTEXT_PACKAGE=gnome-music
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
                    [The prefix for our gettext translation domains.])
-IT_PROG_INTLTOOL(0.26)
 
 YELP_HELP_INIT
 
diff --git a/data/Makefile.am b/data/Makefile.am
index 99c7bfd..ff8bb54 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -6,15 +6,16 @@ resourcedir = $(pkgdatadir)
 resource_DATA = gnome-music.gresource
 
 appsdir = $(datadir)/applications
-apps_DATA = org.gnome.Music.desktop
-
-@INTLTOOL_DESKTOP_RULE@
+apps_in_files = org.gnome.Music.desktop.in
+apps_DATA = $(apps_in_files:.desktop.in=.desktop)
+$(apps_DATA): $(apps_in_files)
+       $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
 
 appdatadir = $(datadir)/appdata
-appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files = org.gnome.Music.appdata.xml.in
-
-@INTLTOOL_XML_RULE@
+appdata_DATA = $(appdata_in_files:.xml.in=.xml)
+$(appdata_DATA): $(appdata_in_files)
+       $(AM_V_GEN) $(MSGFMT) --xml --template $< -d $(top_srcdir)/po -o $@
 
 man1_MANS = gnome-music.1
 
diff --git a/data/org.gnome.Music.appdata.xml.in b/data/org.gnome.Music.appdata.xml.in
index 07cac4e..031c436 100644
--- a/data/org.gnome.Music.appdata.xml.in
+++ b/data/org.gnome.Music.appdata.xml.in
@@ -3,12 +3,12 @@
   <id>org.gnome.Music.desktop</id>
   <metadata_license>CC0-1.0</metadata_license>
   <project_license>GPL-2.0+ and LGPL-2.0+ and CC-BY-SA-4.0</project_license>
-  <_name>GNOME Music</_name>
-  <_summary>Play and organize your music collection</_summary>
+  <name>GNOME Music</name>
+  <summary>Play and organize your music collection</summary>
   <description>
-    <_p>
+    <p>
       Music is the new GNOME music playing application.
-    </_p>
+    </p>
   </description>
   <screenshots>
     <screenshot type="default">
diff --git a/data/org.gnome.Music.desktop.in b/data/org.gnome.Music.desktop.in
index 076afb5..6c11b09 100644
--- a/data/org.gnome.Music.desktop.in
+++ b/data/org.gnome.Music.desktop.in
@@ -1,11 +1,11 @@
 [Desktop Entry]
-_Name=Music
-_GenericName=Music Player
-_Comment=Play and organize your music collection
+Name=Music
+GenericName=Music Player
+Comment=Play and organize your music collection
 Icon=gnome-music
 Exec=gnome-music
 Terminal=false
 Type=Application
 Categories=GNOME;GTK;AudioVideo;Player;Audio;
-_Keywords=Music;Player;
+Keywords=Music;Player;
 StartupNotify=true
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..10357d6
--- /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 = Free Software Foundation, Inc.
+
+# 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 = 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 515063d..d267788 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,6 +1,5 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
-[encoding: UTF-8]
 data/org.gnome.Music.appdata.xml.in
 data/org.gnome.Music.desktop.in
 data/org.gnome.Music.gschema.xml
@@ -32,15 +31,15 @@ gnomemusic/widgets/disclistboxwidget.py
 gnomemusic/widgets/playlistdialog.py
 gnomemusic/widgets/starhandlerwidget.py
 gnomemusic/window.py
-[type: gettext/glade]data/AboutDialog.ui.in
-[type: gettext/glade]data/AlbumWidget.ui
-[type: gettext/glade]data/app-menu.ui
-[type: gettext/glade]data/ArtistAlbumsWidget.ui
-[type: gettext/glade]data/headerbar.ui
-[type: gettext/glade]data/help-overlay.ui
-[type: gettext/glade]data/NoMusic.ui
-[type: gettext/glade]data/PlayerToolbar.ui
-[type: gettext/glade]data/PlaylistControls.ui
-[type: gettext/glade]data/PlaylistDialog.ui
-[type: gettext/glade]data/SelectionToolbar.ui
-[type: gettext/glade]data/TrackWidget.ui
+data/AboutDialog.ui.in
+data/AlbumWidget.ui
+data/app-menu.ui
+data/ArtistAlbumsWidget.ui
+data/headerbar.ui
+data/help-overlay.ui
+data/NoMusic.ui
+data/PlayerToolbar.ui
+data/PlaylistControls.ui
+data/PlaylistDialog.ui
+data/SelectionToolbar.ui
+data/TrackWidget.ui


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