1#! /bin/sh 2. "${srcdir=.}/init.sh"; path_prepend_ . ../src 3 4# Test that gettext() does basic translation lookup. 5 6test -d in-1 || mkdir in-1 7test -d in-1/fr || mkdir in-1/fr 8test -d in-1/fr/LC_MESSAGES || mkdir in-1/fr/LC_MESSAGES 9 10: ${MSGFMT=msgfmt} 11${MSGFMT} -o in-1/fr/LC_MESSAGES/tstprog.mo "$wabs_srcdir"/intl-1.po 12 13: ${DIFF=diff} 14cat <<EOF > in-1.ok 15fromage 16EOF 17 18: ${LOCALE_FR=fr_FR} 19: ${LOCALE_FR_UTF8=fr_FR.UTF-8} 20if test $LOCALE_FR != none; then 21 prepare_locale_ in-1/fr in-1/$LOCALE_FR 22 ../intl-1-prg in-1 $LOCALE_FR > in-1.tmp || Exit 1 23 LC_ALL=C tr -d '\r' < in-1.tmp > in-1.out || Exit 1 24 ${DIFF} in-1.ok in-1.out || Exit 1 25fi 26if test $LOCALE_FR_UTF8 != none; then 27 prepare_locale_ in-1/fr in-1/$LOCALE_FR_UTF8 28 ../intl-1-prg in-1 $LOCALE_FR_UTF8 > in-1.tmp || Exit 1 29 LC_ALL=C tr -d '\r' < in-1.tmp > in-1.out || Exit 1 30 ${DIFF} in-1.ok in-1.out || Exit 1 31fi 32if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then 33 if test -f /usr/bin/localedef; then 34 echo "Skipping test: no french locale is installed" 35 else 36 echo "Skipping test: no french locale is supported" 37 fi 38 Exit 77 39fi 40 41Exit 0 42