From b3ec0170abb2c3a203bf4147b6e60840609ec2e0 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 30 May 2003 23:13:55 +0000 Subject: [PATCH] Backport better handling of ALL_LINGUAS from gettext.m4. (#103808, Andras Fri May 30 19:09:25 2003 Owen Taylor * m4macros/glib-gettext.m4: Backport better handling of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-12 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ m4macros/glib-gettext.m4 | 43 ++++++++++++++++++++++++++++++++-------- 7 files changed, 65 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4450fb290..d4830d450 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4450fb290..d4830d450 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 4450fb290..d4830d450 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 4450fb290..d4830d450 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 4450fb290..d4830d450 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 4450fb290..d4830d450 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Fri May 30 19:09:25 2003 Owen Taylor + + * m4macros/glib-gettext.m4: Backport better handling + of ALL_LINGUAS from gettext.m4. (#103808, Andras Salamon) + Fri May 30 18:46:05 2003 Owen Taylor * m4macros/glib-gettext.m4: expand $exec_prefix as diff --git a/m4macros/glib-gettext.m4 b/m4macros/glib-gettext.m4 index add13da0a..488de2149 100644 --- a/m4macros/glib-gettext.m4 +++ b/m4macros/glib-gettext.m4 @@ -1,3 +1,16 @@ +# Copyright (C) 1995-2002 Free Software Foundation, Inc. +# Copyright (C) 2001-2003 Red Hat, Inc. +# +# This file is free software, distributed under the terms of the GNU +# General Public License. As a special exception to the GNU General +# Public License, this file may be distributed as part of a program +# that contains a configuration script generated by Autoconf, under +# the same distribution terms as the rest of that program. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# # Macro to add for using GNU gettext. # Ulrich Drepper , 1995, 1996 # @@ -7,10 +20,8 @@ # Major rework to remove unused code # Owen Taylor , 12/11/2002 # -# This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# +# Added better handling of ALL_LINGUAS from GNU gettext version +# written by Bruno Haible, Owen Taylor 5/30/3002 # # We need this here as well, since someone might use autoconf-2.5x @@ -260,10 +271,26 @@ glib_DEFUN(GLIB_GNU_GETTEXT, else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac + for presentlang in $ALL_LINGUAS; do + useit=no + if test "%UNSET%" != "${LINGUAS-%UNSET%}"; then + desiredlanguages="$LINGUAS" + else + desiredlanguages="$ALL_LINGUAS" + fi + for desiredlang in $desiredlanguages; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS)