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