[PATCH] Use autopoint for GLib



Hi,

I noticed disable-nls wasn't available so I dug until I came with a solution.

I'm attaching a patch that makes use of autopoint and seems to work fine.

I would have created a bug report but the bug reporting form is a joke [1].

Best regards.

[1] http://bugzilla.gnome.org/simple-bug-guide.cgi

-- 
Felipe Contreras
Index: configure.in
===================================================================
--- configure.in	(revision 6879)
+++ configure.in	(working copy)
@@ -433,24 +433,23 @@
 dnl gettext support
 dnl
 
-ALL_LINGUAS="am ar as az be be latin bg bn bn_IN bs ca cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ka kn ko ku lt lv mg mk ml mn mr ms nb ne nl nn oc or pa pl pt pt_BR ro ru rw si sk sl sq sr sr Latn sr ije sv ta te th tl tr tt uk vi wa xh yi zh_CN zh_HK zh_TW"
-GLIB_GNU_GETTEXT
+AM_GNU_GETTEXT_VERSION([0.11.5])
+AM_GNU_GETTEXT([external])
 
-if test "$gt_cv_have_gettext" != "yes" ; then
-  AC_MSG_ERROR([
-*** You must have either have gettext support in your C library, or use the 
-*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
-])
+if test "$USE_NLS" = "yes"; then
+	GETTEXT_PACKAGE=[glib20]
+else
+	GETTEXT_PACKAGE=[NULL]
 fi
 
-LIBS="$INTLLIBS $LIBS"
-
-GETTEXT_PACKAGE=glib20
 AC_SUBST(GETTEXT_PACKAGE)
-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, ["$GETTEXT_PACKAGE"], 
-  [Define the gettext package to be used])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
+		   [Define the gettext package to be used])
 
-GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR)
+dnl define LOCALEDIR in config.h
+AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
+AC_DEFINE_UNQUOTED([GLIB_LOCALE_DIR], "$LOCALEDIR",
+		   [Define the location where the catalogs will be installed])
 
 dnl
 dnl Now we are done with gettext checks, figure out ICONV_LIBS
Index: m4/as-ac-expand.m4
===================================================================
--- m4/as-ac-expand.m4	(revision 0)
+++ m4/as-ac-expand.m4	(revision 0)
@@ -0,0 +1,43 @@
+dnl as-ac-expand.m4 0.2.0
+dnl autostars m4 macro for expanding directories using configure's prefix
+dnl thomas apestaart org
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+dnl example
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])
Index: autogen.sh
===================================================================
--- autogen.sh	(revision 6879)
+++ autogen.sh	(working copy)
@@ -100,14 +100,15 @@
   fi
 fi
 
-$ACLOCAL $ACLOCAL_FLAGS || exit $?
+$ACLOCAL -I m4 $ACLOCAL_FLAGS || exit $?
 
-libtoolize --force || exit $?
+autopoint --force || exit $?
+libtoolize --force --copy || exit $?
 gtkdocize || exit $?
 
 autoheader || exit $?
 
-$AUTOMAKE --add-missing || exit $?
+$AUTOMAKE --add-missing --copy || exit $?
 autoconf || exit $?
 cd $ORIGDIR || exit $?
 
Index: po/LINGUAS
===================================================================
--- po/LINGUAS	(revision 0)
+++ po/LINGUAS	(revision 0)
@@ -0,0 +1 @@
+am ar as az be be latin bg bn bn_IN bs ca cs cy da de dz el en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu hy id is it ja ka kn ko ku lt lv mg mk ml mn mr ms nb ne nl nn oc or pa pl pt pt_BR ro ru rw si sk sl sq sr sr Latn sr ije sv ta te th tl tr tt uk vi wa xh yi zh_CN zh_HK zh_TW
Index: po/Makevars
===================================================================
--- po/Makevars	(revision 0)
+++ po/Makevars	(revision 0)
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(GETTEXT_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_
+
+# 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 =
+
+# 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 = http://bugzilla.gnome.org/
+
+# 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 =


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