From: Bruno Haible Date: Fri, 3 Aug 2001 12:18:40 +0000 (+0000) Subject: Set of languages moved from configure.in to po/LINGUAS. X-Git-Tag: v0.11~567 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8bd592eff9af6f8de9e2b5ea80bd461d534768c;p=thirdparty%2Fgettext.git Set of languages moved from configure.in to po/LINGUAS. --- diff --git a/ChangeLog b/ChangeLog index a14985bc8..ed72ebfe9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-07-22 Bruno Haible + + * configure.in (ALL_LINGUAS): Remove assignment. + 2001-08-02 Bruno Haible * README: Change bug report address to . diff --git a/configure.in b/configure.in index 3b800880c..a063fcb49 100644 --- a/configure.in +++ b/configure.in @@ -1,14 +1,11 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) -AC_REVISION($Revision: 1.36 $) +AC_REVISION($Revision: 1.37 $) AC_INIT(src/msgfmt.c) AM_INIT_AUTOMAKE(gettext, 0.11) RELEASE_DATE=2001-05-23 dnl in "date +%Y-%m-%d" format AM_CONFIG_HEADER(config.h) -dnl Set of available languages. -ALL_LINGUAS="cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh" - dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL diff --git a/doc/ChangeLog b/doc/ChangeLog index 7de23f062..77c020b23 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2001-07-22 Bruno Haible + + * gettext.texi (po/LINGUAS): New node. + (configure.in): Remove paragraph about ALL_LINGUAS. + 2001-08-02 Bruno Haible * gettext.texi (Introduction): Change bug report address to diff --git a/doc/gettext.texi b/doc/gettext.texi index c5569513a..62441f6bf 100644 --- a/doc/gettext.texi +++ b/doc/gettext.texi @@ -5022,6 +5022,7 @@ its own functionality. @menu * po/POTFILES.in:: @file{POTFILES.in} in @file{po/} +* po/LINGUAS:: @file{LINGUAS} in @file{po/} * configure.in:: @file{configure.in} at top level * config.guess:: @file{config.guess}, @file{config.sub} at top level * aclocal:: @file{aclocal.m4} at top level @@ -5030,7 +5031,7 @@ its own functionality. * src/Makefile:: @file{Makefile.in} in @file{src/} @end menu -@node po/POTFILES.in, configure.in, Adjusting Files, Adjusting Files +@node po/POTFILES.in, po/LINGUAS, Adjusting Files, Adjusting Files @subsection @file{POTFILES.in} in @file{po/} The @file{po/} directory should receive a file named @@ -5062,7 +5063,31 @@ list those source files containing strings marked for translation of your whole distribution, rather than the location of the @file{POTFILES.in} file itself. -@node configure.in, config.guess, po/POTFILES.in, Adjusting Files +@node po/LINGUAS, configure.in, po/POTFILES.in, Adjusting Files +@subsection @file{LINGUAS} in @file{po/} + +The @file{po/} directory should also receive a file named +@file{LINGUAS}. This file contains the list of available translations. +It is a whitespace separated list. Hash-marked comments and white lines +are ignored. Here is an example file: + +@example +@group +# Set of available languages. +de fr +@end group +@end example + +@noindent +This example means that German and French PO files are available, so +that these languages are currently supported by your package. If you +want to further restrict, at installation time, the set of installed +languages, this should not be done by modifying the @file{LINGUAS} file, +but rather by using the @code{LINGUAS} environment variable +(@pxref{Installers}). + + +@node configure.in, config.guess, po/LINGUAS, Adjusting Files @subsection @file{configure.in} at top level @enumerate @@ -5085,23 +5110,6 @@ and @samp{@value{VERSION}} by its version numbers, exactly as they should appear in the packaged @code{tar} file name of your distribution (@file{gettext-@value{VERSION}.tar.gz}, here). -@item Declare the available translations. - -This is done by defining @code{ALL_LINGUAS} to the white separated, -quoted list of available languages, in a single line, like this: - -@example -ALL_LINGUAS="de fr" -@end example - -@noindent -This example means that German and French PO files are available, so -that these languages are currently supported by your package. If you -want to further restrict, at installation time, the set of installed -languages, this should not be done by modifying @code{ALL_LINGUAS} in -@file{configure.in}, but rather by using the @code{LINGUAS} environment -variable (@pxref{Installers}). - @item Check for internationalization support. Here is the main @code{m4} macro for triggering internationalization diff --git a/m4/ChangeLog b/m4/ChangeLog index 0a7fe9653..590cb273a 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,10 @@ +2001-07-22 Bruno Haible + + * gettext.m4 (AM_GNU_GETTEXT): Remove computation of CATALOGS. + (AM_WITH_NLS): Compute ALL_LINGUAS, GMOFILES, POFILES, CATALOGS while + creating po/Makefile from po/Makefile.in. Remove computation of + GMOFILES, POFILES during configure. + 2001-07-22 Bruno Haible * gettext.m4 (AM_WITH_NLS): Simplify the logic. Use the same tests diff --git a/m4/gettext.m4 b/m4/gettext.m4 index 43fdd040a..1b3a59f74 100644 --- a/m4/gettext.m4 +++ b/m4/gettext.m4 @@ -64,38 +64,6 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) AM_LC_MESSAGES AM_WITH_NLS([$1],[$2],[$3]) - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for presentlang in $ALL_LINGUAS; do - useit=no - for desiredlang in ${LINGUAS-$ALL_LINGUAS}; 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) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate is. @@ -288,12 +256,62 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "" rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + # ALL_LINGUAS, GMOFILES, POFILES depend on $ac_dir but don't + # depend on user-specified configuration parameters. + if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then + # The LINGUAS file contains the set of available languages. + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assigment from automake. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + fi + GMOFILES= + POFILES= + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + # CATALOGS depends on both $ac_dir and the user's LINGUAS + # environment variable. + INST_LINGUAS= + if test -n "$ALL_LINGUAS"; then + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; 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 + INST_LINGUAS="$INST_LINGUAS $presentlang" + fi + done + fi + CATALOGS= + if test -n "$INST_LINGUAS"; then + for lang in $INST_LINGUAS; do + CATALOGS="$CATALOGS $lang.gmo" + done + fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" - sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@POFILES@|$POFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" fi ;; esac - done]) + done], + [# Capture the value of obsolete $ALL_LINGUAS because we need it to + # compute GMOFILES, POFILES, CATALOGS. But hide it from automake. + eval 'ALL_LINGUAS''="$ALL_LINGUAS"' + # Capture the value of $LINGUAS because we need it to compute CATALOGS. + LINGUAS="$LINGUAS" + ]) dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL @@ -333,23 +351,12 @@ changequote([,])dnl INTLBISON=: fi - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) - AC_SUBST(GMOFILES) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) AC_SUBST(POSUB) dnl For backward compatibility. Some configure.ins may be using this. diff --git a/misc/ChangeLog b/misc/ChangeLog index 458deaf53..017f1b539 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,7 @@ +2001-07-22 Bruno Haible + + * automake.diff: New file. + 2001-08-02 Bruno Haible * gettextize.in: Change bug report address to diff --git a/misc/automake.diff b/misc/automake.diff new file mode 100644 index 000000000..f6850cacc --- /dev/null +++ b/misc/automake.diff @@ -0,0 +1,20 @@ +*** automake.bak Sun Jun 10 16:24:20 2001 +--- automake Sun Jul 22 16:51:04 2001 +*************** +*** 3313,3319 **** + } + else + { +! &am_error ("AM_GNU_GETTEXT in configure.in but \`ALL_LINGUAS' not defined"); + } + } + +--- 3313,3320 ---- + } + else + { +! &am_error ("AM_GNU_GETTEXT in configure.in but po/LINGUAS doesn't exist and \`ALL_LINGUAS' not defined") +! if ! -f "po/LINGUAS"; + } + } + diff --git a/po/ChangeLog b/po/ChangeLog index 59e3b1d71..3f94a4d66 100644 --- a/po/ChangeLog +++ b/po/ChangeLog @@ -1,3 +1,7 @@ +2001-07-22 Bruno Haible + + * LINGUAS: New file, extracted from toplevel configure.in. + 2001-07-22 Bruno Haible * Makefile.in.in: Ensure @CATALOGS@ is not used if NLS is disabled. diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 000000000..fa48b9136 --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1,2 @@ +# Set of available languages. +cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh