2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src ${top_srcdir=..}/../gettext-runtime/src
4 # Test of gettext facilities in the sh language.
5 # Assumes an fr_FR locale is installed.
6 # Assumes the following packages are installed: bash.
8 # Note: This test fails on BeOS because there all locales use the UTF-8
9 # encoding, even the locale fr_FR, thus the output comes out in UTF-8.
23 $echo "`gettext \"'Your command, please?', asked the waiter.\"`"
25 $echo "`eval_ngettext \"a piece of cake\" \"\\$n pieces of cake\" $n`"
28 : ${XGETTEXT=xgettext}
29 ${XGETTEXT} -o prog.tmp --omit-header --no-location prog.sh || exit 1
30 LC_ALL=C tr -d '\r' < prog.tmp > prog.pot || exit 1
33 msgid "'Your command, please?', asked the waiter."
37 msgid "a piece of cake"
38 msgid_plural "$n pieces of cake"
44 ${DIFF} prog.ok prog.pot || exit 1
49 "Content-Type: text/plain; charset=ISO-8859-1\n"
50 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
52 msgid "'Your command, please?', asked the waiter."
53 msgstr "«Votre commande, s'il vous plait», dit le garçon."
55 # Les gateaux allemands sont les meilleurs du monde.
57 msgid "a piece of cake"
58 msgid_plural "$n pieces of cake"
59 msgstr[0] "un morceau de gateau"
60 msgstr[1] "$n morceaux de gateau"
63 : ${MSGMERGE=msgmerge}
64 ${MSGMERGE} -q -o fr.po.tmp fr.po prog.pot || exit 1
65 LC_ALL=C tr -d '\r' < fr.po.tmp > fr.po.new || exit 1
68 ${DIFF} fr.po fr.po.new || exit 1
70 test -d fr || mkdir fr
71 test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
74 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
76 # Test which of the fr_FR locales are installed.
78 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
79 if test $LOCALE_FR != none; then
80 LC_ALL=$LOCALE_FR ../testlocale
87 if test $LOCALE_FR_UTF8 != none; then
88 LC_ALL=$LOCALE_FR_UTF8 ../testlocale
91 77) LOCALE_FR_UTF8=none;;
95 if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
96 if test -f /usr/bin/localedef; then
97 echo "Skipping test: no french locale is installed"
99 echo "Skipping test: no french locale is supported"
106 «Votre commande, s'il vous plait», dit le garçon.
109 cat <<\EOF > prog.oku
110 «Votre commande, s'il vous plait», dit le garçon.
115 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
116 if test $LOCALE_FR != none; then
117 prepare_locale_ fr $LOCALE_FR
118 LANGUAGE= LC_ALL=$LOCALE_FR sh ./prog.sh 2 > prog.out || exit 1
119 ${DIFF} prog.ok prog.out || exit 1
121 if test $LOCALE_FR_UTF8 != none; then
122 prepare_locale_ fr $LOCALE_FR_UTF8
123 LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 sh ./prog.sh 2 > prog.out || exit 1
124 ${DIFF} prog.oku prog.out || exit 1