From: Bruno Haible Date: Mon, 19 Jun 2006 10:49:53 +0000 (+0000) Subject: Use an autoconf-determined locale name. X-Git-Tag: v0.15~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=596b8c096bc61a3139e333d59cc032e54aa439e3;p=thirdparty%2Fgettext.git Use an autoconf-determined locale name. --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 466a2c1c5..81db331d3 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,9 @@ +2006-06-17 Bruno Haible + + * gettext-4: Use a french locale instead of a german locale. Pass + the locale name as an argument to gettext-4-prg. + * gettext-4-prg.c (main): Use the locale name passed as argument. + 2006-06-04 Bruno Haible * recode-sr-latin-2: Skip the test on MacOS X and BeOS. diff --git a/gettext-tools/tests/gettext-4 b/gettext-tools/tests/gettext-4 index f70eb18fc..1e2717901 100755 --- a/gettext-tools/tests/gettext-4 +++ b/gettext-tools/tests/gettext-4 @@ -5,24 +5,30 @@ tmpfiles="" trap 'rm -fr $tmpfiles' 1 2 3 15 -# This test works only on systems that have a de_DE.ISO-8859-1 locale installed. -LC_ALL=de_DE.ISO-8859-1 ./testlocale || { +# This test works only on systems that have a traditional french locale +# installed. +# gettext-4.po is actually a German PO file, but only the encoding of the +# locale matters, not the language. configure has already checked whether +# a traditional french locale is installed; no need to check also for a +# traditional german locale. +: ${LOCALE_FR=fr_FR} +{ test $LOCALE_FR != none && LC_ALL=$LOCALE_FR ./testlocale; } || { if test -f /usr/bin/localedef; then - echo "Skipping test: locale de_DE.ISO-8859-1 not installed" + echo "Skipping test: no traditional french locale is installed" else - echo "Skipping test: locale de_DE.ISO-8859-1 not supported" + echo "Skipping test: no traditional french locale is supported" fi exit 77 } -tmpfiles="$tmpfiles de_DE" -test -d de_DE || mkdir de_DE -test -d de_DE/LC_MESSAGES || mkdir de_DE/LC_MESSAGES +tmpfiles="$tmpfiles fr_FR" +test -d fr_FR || mkdir fr_FR +test -d fr_FR/LC_MESSAGES || mkdir fr_FR/LC_MESSAGES : ${MSGFMT=msgfmt} -${MSGFMT} -o de_DE/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-4.po +${MSGFMT} -o fr_FR/LC_MESSAGES/codeset.mo ${top_srcdir}/tests/gettext-4.po -./gettext-4-prg || exit 1 +./gettext-4-prg $LOCALE_FR || exit 1 rm -fr $tmpfiles diff --git a/gettext-tools/tests/gettext-4-prg.c b/gettext-tools/tests/gettext-4-prg.c index dea6d48f2..cc5e8050c 100644 --- a/gettext-tools/tests/gettext-4-prg.c +++ b/gettext-tools/tests/gettext-4-prg.c @@ -33,7 +33,7 @@ #include "libgnuintl.h" int -main (void) +main (int argc, char *argv[]) { char *s; int result = 0; @@ -46,7 +46,7 @@ main (void) unsetenv ("LANG"); unsetenv ("OUTPUT_CHARSET"); - xsetenv ("LC_ALL", "de_DE.ISO-8859-1", 1); + xsetenv ("LC_ALL", argv[1], 1); setlocale (LC_ALL, ""); textdomain ("codeset"); bindtextdomain ("codeset", ".");