[dasher] g/c gnome-common glib-gettext and intltool



commit b5595c7d10c8d1de1f586e8ad5f7c42563f57377
Author: Patrick Welche <prlw1 cam ac uk>
Date:   Thu Sep 1 17:26:21 2016 +0100

    g/c gnome-common glib-gettext and intltool
    
    Should also fix
    https://bugzilla.gnome.org/show_bug.cgi?id=763370

 .gitignore                         |    5 +-
 Data/Makefile.am                   |   20 +--
 Data/dasher.desktop.in.in          |    6 +-
 Makefile.am                        |   16 +--
 Src/DasherCore/MandarinAlphMgr.cpp |    6 -
 Src/Gtk2/Makefile.am               |    4 +-
 Src/Makefile.am                    |    2 -
 Src/main.cc                        |    2 +-
 autogen.sh                         |   24 +--
 configure.ac                       |   20 +--
 m4/README                          |    2 -
 m4/glib-gettext.m4                 |  436 ------------------------------------
 m4/intltool.m4                     |  237 -------------------
 po/Makevars                        |   78 +++++++
 po/POTFILES.in                     |   10 +-
 15 files changed, 99 insertions(+), 769 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c769ace..65c2a81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,12 +21,9 @@ stamp-*
 /config.log
 /config.status
 /configure
-/intltool-extract.in
-/intltool-merge.in
-/intltool-update.in
 /libtool
-/po/.intltool-merge-cache
 /po/Makefile.in.in
+/po/Makevars.template
 /po/POTFILES
 /Data/dasher.desktop
 /Data/dasher.desktop.in
diff --git a/Data/Makefile.am b/Data/Makefile.am
index 1b73bfd..bdd8bef 100644
--- a/Data/Makefile.am
+++ b/Data/Makefile.am
@@ -1,19 +1,14 @@
 SUBDIRS =  training alphabets colours control settings GUI Help
 
 desktopdir = $(datadir)/applications
-desktop_in_files = dasher.desktop.in
-desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
-if USE_INTLTOOL
-@INTLTOOL_DESKTOP_RULE@
-else
+dist_desktop_DATA = dasher.desktop
 dasher.desktop:        dasher.desktop.in
-       cp dasher.desktop.in dasher.desktop
-endif
+       $(AM_V_GEN)$(MSGFMT) --desktop --template dasher.desktop.in -d $(top_srcdir)/po -o dasher.desktop
 
 icondir = $(datadir)/icons/hicolor/48x48/apps
-icon_DATA = dasher.png
+dist_icon_DATA = dasher.png
 svgicondir = $(datadir)/icons/hicolor/scalable/apps
-svgicon_DATA = dasher.svg
+dist_svgicon_DATA = dasher.svg
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
 
@@ -30,9 +25,4 @@ update-icon-cache:
                echo "***   $(gtk_update_icon_cache)"; \
        fi
 
-EXTRA_DIST = \
-               dasher.desktop \
-               $(icon_DATA) \
-               $(svgicon_DATA)
-
-CLEANFILES = dasher.schemas dasher.gschema.xml
+CLEANFILES = dasher.schemas dasher.gschema.xml dasher.desktop dasher.desktop.in
diff --git a/Data/dasher.desktop.in.in b/Data/dasher.desktop.in.in
index 4e7f86a..54d5919 100644
--- a/Data/dasher.desktop.in.in
+++ b/Data/dasher.desktop.in.in
@@ -1,7 +1,7 @@
 [Desktop Entry]
-_Name=Dasher
-_GenericName=Predictive text entry
-_Comment=Enter text without a keyboard
+Name=Dasher
+GenericName=Predictive text entry
+Comment=Enter text without a keyboard
 Exec=dasher
 Icon=dasher
 Terminal=false
diff --git a/Makefile.am b/Makefile.am
index 84ceda7..776f7b8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,4 @@
-SUBDIRS = Src Data Doc
-if USE_INTLTOOL
-SUBDIRS += po
-endif
+SUBDIRS = Src Data Doc po
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -16,22 +13,14 @@ EXTRA_DIST = \
                INSTALL.Windows \
                MAINTAINERS \
                m4/pkg.m4 \
-               m4/glib-gettext.m4 \
                m4/dgconf-2.m4 \
                m4/gnome-doc-utils.m4 \
-               m4/intltool.m4 \
                m4/nls.m4 \
-               intltool-merge.in \
-               intltool-extract.in \
-               intltool-update.in \
                gnome-doc-utils.make \
                .tarball-version \
                build-aux/mkversion
 
 DISTCLEANFILES = \
-               intltool-merge \
-               intltool-extract \
-               intltool-update \
                Data/dasher.desktop \
                Data/Help/Gnome/Makefile
 
@@ -51,9 +40,6 @@ MAINTAINERCLEANFILES = \
                $(srcdir)/ltmain.sh \
                $(srcdir)/missing \
                $(srcdir)/mkinstalldirs \
-               $(srcdir)/intltool-extract.in \
-               $(srcdir)/intltool-merge.in \
-               $(srcdir)/intltool-update.in \
                $(srcdir)/omf.make \
                $(srcdir)/xmldocs.make \
                $(srcdir)/po/Makefile.in.in
diff --git a/Src/DasherCore/MandarinAlphMgr.cpp b/Src/DasherCore/MandarinAlphMgr.cpp
index 9566ed8..93fc790 100644
--- a/Src/DasherCore/MandarinAlphMgr.cpp
+++ b/Src/DasherCore/MandarinAlphMgr.cpp
@@ -238,18 +238,12 @@ void CMandarinAlphMgr::CMandarinTrainer::Train(CAlphabetMap::SymbolStream &syms)
     bHavePy=false; strPy.clear();
   }
   if (unannotated.size()) {
-    // AM_GLIB_GNU_GETTEXT sets HAVE_GETTEXT if it finds a version of gettext
-    // which includes ngettext() - there is no separate HAVE_NGETTEXT.
     ///TRANSLATORS: first string will be the filename; after the end of the string,
     /// some number of output (e.g. Chinese) characters will be appended,
     /// the number of which is the integer here
-#ifdef HAVE_GETTEXT
     const char* msg = ngettext("In file %s, the following %i symbol appeared without annotations saying how 
it should be entered, but it can be entered in several ways. Dasher will not be able to learn how you want to 
enter this symbol:",
                                "In file %s, the following %i symbols appeared without annotations saying how 
they should be entered, but each can be entered in several ways. Dasher will not be able to learn how you 
want to enter these symbols:",
                                unannotated.size());
-#else
-    const char* msg = _("In file %s, the following %i symbols appeared without annotations saying how they 
should be entered, but each can be entered in several ways. Dasher will not be able to learn how you want to 
enter these symbols:");
-#endif
     char *buf(new char[strlen(msg) + GetDesc().length() + 10]);
     sprintf(buf, msg, GetDesc().c_str(), unannotated.size());
     ostringstream withChars;
diff --git a/Src/Gtk2/Makefile.am b/Src/Gtk2/Makefile.am
index 4e58dbe..195d3af 100644
--- a/Src/Gtk2/Makefile.am
+++ b/Src/Gtk2/Makefile.am
@@ -1,9 +1,7 @@
-LIBS = @INTLLIBS@ @LIBS@
-
 noinst_LTLIBRARIES = libdashergtk.la libdashercontrol.la
 
 noinst_PROGRAMS = generate-schema
-generate_schema_SOURCES = GenerateSchema.cpp ../DasherCore/Parameters.cpp
+generate_schema_SOURCES = GenerateSchema.cpp $(top_srcdir)/Src/DasherCore/Parameters.cpp
 
 #bin_PROGRAMS = dasher-config
 
diff --git a/Src/Makefile.am b/Src/Makefile.am
index 1b22bdb..d11a3f8 100644
--- a/Src/Makefile.am
+++ b/Src/Makefile.am
@@ -1,5 +1,3 @@
-LIBS = @INTLLIBS@ @LIBS@
-
 datadir = @datadir@
 localedir = $(datadir)/locale
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
diff --git a/Src/main.cc b/Src/main.cc
index 8fed2bc..085a9d9 100644
--- a/Src/main.cc
+++ b/Src/main.cc
@@ -170,7 +170,7 @@ int main(int argc, char *argv[]) {
   //parse command line options
   // Note to translators: This is the "--help" description of dasher.
   GOptionContext *goptcontext = g_option_context_new(_("- A text input application honouring 
accessibility"));
-  g_option_context_add_main_entries(goptcontext, options, GETTEXT_PACKAGE);
+  g_option_context_add_main_entries(goptcontext, options, PACKAGE);
   g_option_context_add_group(goptcontext, gtk_get_option_group(TRUE));
   GError *error = nullptr;
   if (!g_option_context_parse(goptcontext, &argc, &argv, &error)) {
diff --git a/autogen.sh b/autogen.sh
index ece792d..c5400f2 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,23 +1,3 @@
 #!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-REQUIRED_AUTOMAKE_VERSION=1.8
-
-PKG_NAME="dasher"
-
-(test -f $srcdir/configure.ac \
-  && test -f $srcdir/README \
-  && test -d $srcdir/Src) || {
-    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
-    echo " top-level $PKG_NAME directory"
-    exit 1
-}
-
-which gnome-autogen.sh || {
-    echo "You need to install gnome-common from the GNOME CVS"
-    exit 1
-}
-USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh
+autoreconf -vif
+test -n "$NOCONFIGURE" || ./configure $*
diff --git a/configure.ac b/configure.ac
index 2cf6d07..43f958f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,24 +22,10 @@ AC_CONFIG_LIBOBJ_DIR([Src/Common])
 AM_INIT_AUTOMAKE([1.8 gnu check-news dist-bzip2 subdir-objects])
 AM_MAINTAINER_MODE
 
-AC_PROG_MAKE_SET
-
-# IT_PROG_INTLTOOL requires AM_NLS but ignores --enable-nls
-AM_NLS
-AM_CONDITIONAL(USE_INTLTOOL, test "x$USE_NLS" = "xyes")
-AS_IF([test "x$USE_NLS" = "xyes"],[
-IT_PROG_INTLTOOL([0.40.1])
-],
-[touch po/Makefile.in.in]) dnl as intltoolize insists
-
 LT_INIT([disable-static])
 
-dnl AM_ICONV
-
-GETTEXT_PACKAGE=dasher
-AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
-AM_GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.19])
+AM_GNU_GETTEXT([external])
 
 CXXFLAGS="$CXXFLAGS -std=c++0x"
 AC_PROG_CXX
@@ -403,8 +389,6 @@ AC_SUBST(gthread_CFLAGS)
 AC_SUBST(hildon_LIBS)
 AC_SUBST(hildon_CFLAGS)
 
-AC_SUBST(GETTEXT_PACKAGE)
-
 AM_CONDITIONAL(DOGTK, test x$BUILDGTK = xtrue)
 AM_CONDITIONAL(DOQTE, test x$WITHQTE = xtrue)
 AM_CONDITIONAL(USE_SPEECHDISPATCHER, test $speech_module = speechdispatcher)
diff --git a/m4/README b/m4/README
index bfb5206..f0f0a73 100644
--- a/m4/README
+++ b/m4/README
@@ -1,6 +1,4 @@
 pkg.m4:                      pkg-config-0.27.1
-glib-gettext.m4:             glib of 2013-01-23 (2.35.4)
 dgconf-2.m4:                 modified gconf-2.m4.in from gconf of 2009-04-28 (git HEAD)
 gnome-doc-utils.m4:          gnome-doc-utils-0.20.10
-intltool.m4:                 intltool-0.50.2
 nls.m4:                      gettext of 2009-04-28 (0.18)
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..5b59ba0
--- /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 = --keyword=_ --keyword=N_ --from-code=UTF-8
+
+# 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 = see AUTHORS
+
+# 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 = 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 = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 095ddfc..6c437cf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,11 +2,11 @@
 # Please keep this file sorted alphabetically.
 # Use "make check" to check for missing files:
 Data/dasher.desktop.in.in
-[type: gettext/glade]Data/GUI/dashermaemofullscreen.ui
-[type: gettext/glade]Data/GUI/dashermaemo.preferences.ui
-[type: gettext/glade]Data/GUI/dashermaemo.ui
-[type: gettext/glade]Data/GUI/dasher.preferences.ui
-[type: gettext/glade]Data/GUI/dasher.traditional.ui
+Data/GUI/dashermaemofullscreen.ui
+Data/GUI/dashermaemo.preferences.ui
+Data/GUI/dashermaemo.ui
+Data/GUI/dasher.preferences.ui
+Data/GUI/dasher.traditional.ui
 Src/DasherCore/AbstractXMLParser.cpp
 Src/DasherCore/Alphabet/AlphabetMap.cpp
 Src/DasherCore/AlphabetManager.cpp


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