From: Bruno Haible Date: Fri, 6 Dec 2024 20:35:08 +0000 (+0100) Subject: build: Read LINGUAS at 'make' time, not at 'configure' time. X-Git-Tag: v0.24~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e3ae8b251a6f861ab6ea85659d4321585adfbed;p=thirdparty%2Fgettext.git build: Read LINGUAS at 'make' time, not at 'configure' time. * gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS): Move the obsolete ALL_LINGUAS check. Define DESIRED_LINGUAS. Don't compute ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, INST_LINGUAS, CATALOGS any more. (AM_POSTPROCESS_PO_MAKEFILE): Don't compute and substitute ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, PROPERTIESFILES, CLASSFILES, QMFILES, MSGFILES, RESOURCESDLLFILES, INST_LINGUAS, CATALOGS, JAVACATALOGS, QTCATALOGS, TCLCATALOGS, CSHARPCATALOGS any more. Don't add rules for Tcl and C# catalogs any more. * gettext-runtime/po/Makefile.in.in (ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES): Define with a computed value. (DESIRED_LINGUAS): New macro. (INST_LINGUAS, CATALOGS): Define with a computed value. * gettext-tools/examples/po/Makefile.am (ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES): Define with a computed value. * gettext-tools/examples/hello-*/po/Makefile.am (ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES): Define with a computed value. (DESIRED_LINGUAS): New macro. (INST_LINGUAS, CATALOGS): Define with a computed value. * gettext-tools/examples/hello-csharp*/po/Makefile.am (ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, RESOURCESDLLFILES): Define with a computed value. Include .csharp-rules. (DESIRED_LINGUAS): New macro. (INST_LINGUAS, CATALOGS): Define with a computed value. (DISTCLEANFILES): New variable. * gettext-tools/examples/hello-tcl*/po/Makefile.am (ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, MSGFILES): Define with a computed value. Include .tcl-rules. (DESIRED_LINGUAS): New macro. (INST_LINGUAS, CATALOGS): Define with a computed value. (DISTCLEANFILES): New variable. --- diff --git a/gettext-runtime/m4/po.m4 b/gettext-runtime/m4/po.m4 index d90001ce5..53ee71f7f 100644 --- a/gettext-runtime/m4/po.m4 +++ b/gettext-runtime/m4/po.m4 @@ -98,6 +98,16 @@ changequote([,])dnl test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + 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 + + dnl Capture the value of LINGUAS because we need it to compute CATALOGS. + dnl In the Makefile, call it DESIRED_LINGUAS (because there, LINGUAS denotes + dnl the set of available translations, given by the developer). + DESIRED_LINGUAS="${LINGUAS-\$(ALL_LINGUAS)}" + AC_SUBST([DESIRED_LINGUAS]) + AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" @@ -113,88 +123,16 @@ changequote([,])dnl # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then POMAKEFILEDEPS="POTFILES.in" - # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES 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 "$OBSOLETE_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" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" - else - # The set of available languages was given in configure.in. - ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS - fi - # Compute POFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) - # Compute UPDATEPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) - # Compute DUMMYPOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) - # Compute GMOFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) - case "$ac_given_srcdir" in - .) srcdirpre= ;; - *) srcdirpre='$(srcdir)/' ;; - esac - POFILES= - UPDATEPOFILES= - DUMMYPOFILES= - GMOFILES= - for lang in $ALL_LINGUAS; do - POFILES="$POFILES $srcdirpre$lang.po" - UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" - DUMMYPOFILES="$DUMMYPOFILES $lang.nop" - GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - 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 - if test "%UNSET%" != "$LINGUAS"; 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" | "$presentlang"_* | "$presentlang".* | "$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 "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + sed -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in @@ -207,220 +145,23 @@ changequote([,])dnl ;; esac done]], - [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. - OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" - # Capture the value of LINGUAS because we need it to compute CATALOGS. - LINGUAS="${LINGUAS-%UNSET%}" - ]) + []) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ - # When this code is run, in config.status, two variables have already been - # set: - # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, - # - LINGUAS is the value of the environment variable LINGUAS at configure - # time. - changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` - ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` - ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` - # In autoconf-2.13 it is called $ac_given_srcdir. - # In autoconf-2.50 it is called $srcdir. - test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" - case "$ac_given_srcdir" in - .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; - /*) top_srcdir="$ac_given_srcdir" ;; - *) top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - # Find a way to echo strings without interpreting backslash. - if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='echo' - else - if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then - gt_echo='printf %s\n' - else - echo_func () { - cat < "$ac_file.tmp" - tab=`printf '\t'` - if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` - cat >> "$ac_file.tmp" < /dev/null; then - # Add dependencies that cannot be formulated as a simple suffix rule. - for lang in $ALL_LINGUAS; do - frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` - cat >> "$ac_file.tmp" < "$ac_file.tmp" if test -n "$POMAKEFILEDEPS"; then cat >> "$ac_file.tmp" <&3 "$$frobbedlang/\$$(DOMAIN).resources.dll: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --csharp -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po -r \$$(DOMAIN)\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --csharp -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po -r \"\$$(DOMAIN)\" || { rm -f \"\$$(srcdir)/$$frobbedlang/\$$(DOMAIN).resources.dll\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang/$(DOMAIN).resources.dll; \ + done 3> .csharp-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .csharp-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang))/$(DOMAIN).resources.dll) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$$/-Latn/' -e 's/@cyrillic$$/-Cyrl/' -e 's/^sr-SP$$/sr-SP-Latn/' -e 's/^uz-UZ$$/uz-UZ-Latn/'`; \ + echo $$lang/$(DOMAIN).resources.dll; \ + done SUFFIXES = .nop .po-create .po-update @@ -259,6 +296,8 @@ uninstall-local-yes: html ID: +DISTCLEANFILES = .csharp-rules + MOSTLYCLEANFILES = MOSTLYCLEANFILES += stamp-poT MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po diff --git a/gettext-tools/examples/hello-csharp/po/Makefile.am b/gettext-tools/examples/hello-csharp/po/Makefile.am index fcf89a3ec..421d1c721 100644 --- a/gettext-tools/examples/hello-csharp/po/Makefile.am +++ b/gettext-tools/examples/hello-csharp/po/Makefile.am @@ -69,18 +69,55 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) -RESOURCESDLLFILES = @RESOURCESDLLFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(frob $(lang))/$(DOMAIN).resources.dll) -CATALOGS = @CSHARPCATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll) +# It also creates the .csharp-rules file. +RESOURCESDLLFILES != tab=`printf '\t'`; \ + for lang in $(ALL_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$$/-Latn/' -e 's/@cyrillic$$/-Cyrl/' -e 's/^sr-SP$$/sr-SP-Latn/' -e 's/^uz-UZ$$/uz-UZ-Latn/'`; \ + echo 1>&3 "$$frobbedlang/\$$(DOMAIN).resources.dll: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --csharp -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po -r \$$(DOMAIN)\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --csharp -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po -r \"\$$(DOMAIN)\" || { rm -f \"\$$(srcdir)/$$frobbedlang/\$$(DOMAIN).resources.dll\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang/$(DOMAIN).resources.dll; \ + done 3> .csharp-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .csharp-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang))/$(DOMAIN).resources.dll) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$$/-Latn/' -e 's/@cyrillic$$/-Cyrl/' -e 's/^sr-SP$$/sr-SP-Latn/' -e 's/^uz-UZ$$/uz-UZ-Latn/'`; \ + echo $$lang/$(DOMAIN).resources.dll; \ + done SUFFIXES = .nop .po-create .po-update @@ -259,6 +296,8 @@ uninstall-local-yes: html ID: +DISTCLEANFILES = .csharp-rules + MOSTLYCLEANFILES = MOSTLYCLEANFILES += stamp-poT MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po diff --git a/gettext-tools/examples/hello-gawk/po/Makefile.am b/gettext-tools/examples/hello-gawk/po/Makefile.am index 1e2bff301..6659d3b83 100644 --- a/gettext-tools/examples/hello-gawk/po/Makefile.am +++ b/gettext-tools/examples/hello-gawk/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-guile/po/Makefile.am b/gettext-tools/examples/hello-guile/po/Makefile.am index 7d6fdd204..b1d2ee2bc 100644 --- a/gettext-tools/examples/hello-guile/po/Makefile.am +++ b/gettext-tools/examples/hello-guile/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-java-awt/po/Makefile.am b/gettext-tools/examples/hello-java-awt/po/Makefile.am index b72aebf87..d8a6f4b5f 100644 --- a/gettext-tools/examples/hello-java-awt/po/Makefile.am +++ b/gettext-tools/examples/hello-java-awt/po/Makefile.am @@ -68,20 +68,44 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) -PROPERTIESFILES = @PROPERTIESFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) -CLASSFILES = @CLASSFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) -CATALOGS = @JAVACATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.properties; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.class; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS != for lang in $(INST_LINGUAS); do echo $(DOMAIN)_$$lang.properties; done SUFFIXES = .po .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am b/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am index b72aebf87..d8a6f4b5f 100644 --- a/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am +++ b/gettext-tools/examples/hello-java-qtjambi/po/Makefile.am @@ -68,20 +68,44 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) -PROPERTIESFILES = @PROPERTIESFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) -CLASSFILES = @CLASSFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) -CATALOGS = @JAVACATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.properties; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.class; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS != for lang in $(INST_LINGUAS); do echo $(DOMAIN)_$$lang.properties; done SUFFIXES = .po .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-java-swing/po/Makefile.am b/gettext-tools/examples/hello-java-swing/po/Makefile.am index b72aebf87..d8a6f4b5f 100644 --- a/gettext-tools/examples/hello-java-swing/po/Makefile.am +++ b/gettext-tools/examples/hello-java-swing/po/Makefile.am @@ -68,20 +68,44 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) -PROPERTIESFILES = @PROPERTIESFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) -CLASSFILES = @CLASSFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) -CATALOGS = @JAVACATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.properties; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.class; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS != for lang in $(INST_LINGUAS); do echo $(DOMAIN)_$$lang.properties; done SUFFIXES = .po .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-java/po/Makefile.am b/gettext-tools/examples/hello-java/po/Makefile.am index b72aebf87..d8a6f4b5f 100644 --- a/gettext-tools/examples/hello-java/po/Makefile.am +++ b/gettext-tools/examples/hello-java/po/Makefile.am @@ -68,20 +68,44 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) -PROPERTIESFILES = @PROPERTIESFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) -CLASSFILES = @CLASSFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(DOMAIN)_$(lang).properties) -CATALOGS = @JAVACATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) +PROPERTIESFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.properties; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) +CLASSFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$(DOMAIN)_$$lang.class; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(DOMAIN)_$(lang).properties) +CATALOGS != for lang in $(INST_LINGUAS); do echo $(DOMAIN)_$$lang.properties; done SUFFIXES = .po .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-librep/po/Makefile.am b/gettext-tools/examples/hello-librep/po/Makefile.am index 0caae68fc..3e4180edf 100644 --- a/gettext-tools/examples/hello-librep/po/Makefile.am +++ b/gettext-tools/examples/hello-librep/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-pascal/po/Makefile.am b/gettext-tools/examples/hello-pascal/po/Makefile.am index 91eec4d82..7d58485a8 100644 --- a/gettext-tools/examples/hello-pascal/po/Makefile.am +++ b/gettext-tools/examples/hello-pascal/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-perl/po/Makefile.am b/gettext-tools/examples/hello-perl/po/Makefile.am index 15d18746d..8a78965fb 100644 --- a/gettext-tools/examples/hello-perl/po/Makefile.am +++ b/gettext-tools/examples/hello-perl/po/Makefile.am @@ -81,18 +81,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-php/po/Makefile.am b/gettext-tools/examples/hello-php/po/Makefile.am index 47d02b42c..db7a0aaae 100644 --- a/gettext-tools/examples/hello-php/po/Makefile.am +++ b/gettext-tools/examples/hello-php/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-python/po/Makefile.am b/gettext-tools/examples/hello-python/po/Makefile.am index b13a68a40..4acd1e2b7 100644 --- a/gettext-tools/examples/hello-python/po/Makefile.am +++ b/gettext-tools/examples/hello-python/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-sh/po/Makefile.am b/gettext-tools/examples/hello-sh/po/Makefile.am index e4702cbce..04b2cab54 100644 --- a/gettext-tools/examples/hello-sh/po/Makefile.am +++ b/gettext-tools/examples/hello-sh/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-smalltalk/po/Makefile.am b/gettext-tools/examples/hello-smalltalk/po/Makefile.am index f33f4b5ba..3938cb88f 100644 --- a/gettext-tools/examples/hello-smalltalk/po/Makefile.am +++ b/gettext-tools/examples/hello-smalltalk/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/hello-tcl-tk/po/Makefile.am b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am index 5ac95cf22..53a8c569f 100644 --- a/gettext-tools/examples/hello-tcl-tk/po/Makefile.am +++ b/gettext-tools/examples/hello-tcl-tk/po/Makefile.am @@ -67,18 +67,55 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(frob $(lang)).msg) -MSGFILES = @MSGFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(frob $(lang)).msg) -CATALOGS = @TCLCATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) +# It also creates the .tcl-rules file. +MSGFILES != tab=`printf '\t'`; \ + for lang in $(ALL_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo 1>&3 "$$frobbedlang.msg: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --tcl -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --tcl -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po || { rm -f \"\$$(srcdir)/$$frobbedlang.msg\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang.msg; \ + done 3> .tcl-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .tcl-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang)).msg) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo $$frobbedlang.gmo; \ + done SUFFIXES = .nop .po-create .po-update @@ -253,6 +290,8 @@ uninstall-local-yes: html ID: +DISTCLEANFILES = .tcl-rules + MOSTLYCLEANFILES = MOSTLYCLEANFILES += stamp-poT MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po diff --git a/gettext-tools/examples/hello-tcl/po/Makefile.am b/gettext-tools/examples/hello-tcl/po/Makefile.am index 5ac95cf22..53a8c569f 100644 --- a/gettext-tools/examples/hello-tcl/po/Makefile.am +++ b/gettext-tools/examples/hello-tcl/po/Makefile.am @@ -67,18 +67,55 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(frob $(lang)).msg) -MSGFILES = @MSGFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(frob $(lang)).msg) -CATALOGS = @TCLCATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) +# It also creates the .tcl-rules file. +MSGFILES != tab=`printf '\t'`; \ + for lang in $(ALL_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo 1>&3 "$$frobbedlang.msg: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --tcl -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --tcl -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po || { rm -f \"\$$(srcdir)/$$frobbedlang.msg\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang.msg; \ + done 3> .tcl-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .tcl-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang)).msg) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo $$frobbedlang.gmo; \ + done SUFFIXES = .nop .po-create .po-update @@ -253,6 +290,8 @@ uninstall-local-yes: html ID: +DISTCLEANFILES = .tcl-rules + MOSTLYCLEANFILES = MOSTLYCLEANFILES += stamp-poT MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po diff --git a/gettext-tools/examples/hello-ycp/po/Makefile.am b/gettext-tools/examples/hello-ycp/po/Makefile.am index a0921b290..b07ad0556 100644 --- a/gettext-tools/examples/hello-ycp/po/Makefile.am +++ b/gettext-tools/examples/hello-ycp/po/Makefile.am @@ -71,18 +71,42 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).gmo) -GMOFILES = @GMOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ - -# This is computed as -# $(foreach lang, user-specified subset of $(LINGUAS), $(lang).gmo) -CATALOGS = @CATALOGS@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We 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). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done SUFFIXES = .po .gmo .nop .po-create .po-update diff --git a/gettext-tools/examples/po/Makefile.am b/gettext-tools/examples/po/Makefile.am index 2bacff0f6..de95dcbe1 100644 --- a/gettext-tools/examples/po/Makefile.am +++ b/gettext-tools/examples/po/Makefile.am @@ -147,12 +147,18 @@ MSGFILTER = msgfilter # This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done -# This is computed as $(foreach lang, $(LINGUAS), $(srcdir)/$(lang).po) -POFILES = @POFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).po-update) -UPDATEPOFILES = @UPDATEPOFILES@ -# This is computed as $(foreach lang, $(LINGUAS), $(lang).nop) -DUMMYPOFILES = @DUMMYPOFILES@ +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done SUFFIXES = .po .nop .po-update