From: Bruno Haible Date: Mon, 10 Aug 2026 19:55:01 +0000 (+0200) Subject: tests: Fix lang-javascript failure on Ubuntu 26.04. X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fgettext.git tests: Fix lang-javascript failure on Ubuntu 26.04. * gettext-tools/tests/lang-javascript: Don't test in the ${LOCALE_FR} locale. --- diff --git a/gettext-tools/tests/lang-javascript b/gettext-tools/tests/lang-javascript index 71529e504..6724b5f3a 100755 --- a/gettext-tools/tests/lang-javascript +++ b/gettext-tools/tests/lang-javascript @@ -78,21 +78,12 @@ case "$host_os" in darwin*) echo "Skipping test: gjs gettext module possibly broken"; Exit 77;; esac -# Test which of the fr_FR locales are installed. : ${LOCALE_FR=fr_FR} : ${LOCALE_FR_UTF8=fr_FR.UTF-8} -# gjs on macOS supports only UTF-8 locales. -case "$host_os" in - darwin*) LOCALE_FR=none ;; -esac -if test $LOCALE_FR != none; then - LC_ALL=$LOCALE_FR ../testlocale - case $? in - 0) ;; - 77) LOCALE_FR=none;; - *) Exit 1;; - esac -fi +# As of 2026, gjs in the ${LOCALE_FR} locale produces ISO-8859-1 encoded output +# when stdout is a terminal, but UTF-8 encoded output when stdout is redirected +# to a file or to a pipe. This prevents us from testing this case. We can only +# test ${LOCALE_FR_UTF8}. if test $LOCALE_FR_UTF8 != none; then LC_ALL=$LOCALE_FR_UTF8 ../testlocale case $? in @@ -101,34 +92,25 @@ if test $LOCALE_FR_UTF8 != none; then *) Exit 1;; esac fi -if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then +if test $LOCALE_FR_UTF8 = none; then if test -f /usr/bin/localedef; then - echo "Skipping test: no french locale is installed" + echo "Skipping test: no french Unicode locale is installed" else - echo "Skipping test: no french locale is supported" + echo "Skipping test: no french Unicode locale is supported" fi Exit 77 fi : ${DIFF=diff} cat <<\EOF > prog.ok -«Votre commande, s'il vous plait», dit le garçon. -EUR remplace FF. -EOF -cat <<\EOF > prog.oku «Votre commande, s'il vous plait», dit le garçon. EUR remplace FF. EOF -: ${LOCALE_FR=fr_FR} : ${LOCALE_FR_UTF8=fr_FR.UTF-8} -if test $LOCALE_FR != none; then - LANGUAGE= LC_ALL=$LOCALE_FR gjs prog.js > prog.out || Exit 1 - ${DIFF} prog.ok prog.out || Exit 1 -fi if test $LOCALE_FR_UTF8 != none; then LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gjs prog.js > prog.out || Exit 1 - ${DIFF} prog.oku prog.out || Exit 1 + ${DIFF} prog.ok prog.out || Exit 1 fi Exit 0