4 trap 'rm -fr $tmpfiles' 1 2 3 15
6 tmpfiles="$tmpfiles cake.tmp cake.pot"
8 ${XGETTEXT} -o cake.tmp --omit-header --no-location ${top_srcdir}/tests/plural-1-prg.c
9 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
10 LC_ALL=C tr -d '\r' < cake.tmp > cake.pot
11 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
13 tmpfiles="$tmpfiles cake.ok"
16 msgid "a piece of cake"
17 msgid_plural "%d pieces of cake"
23 ${DIFF} cake.ok cake.pot || exit 1
25 tmpfiles="$tmpfiles fr.po"
27 # Les gateaux allemands sont les meilleurs du monde.
29 msgid "a piece of cake"
30 msgid_plural "%d pieces of cake"
31 msgstr[0] "un morceau de gateau"
32 msgstr[1] "%d morceaux de gateau"
35 tmpfiles="$tmpfiles fr.po.tmp fr.po.new"
36 : ${MSGMERGE=msgmerge}
37 ${MSGMERGE} -q -o fr.po.tmp fr.po cake.pot
38 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
39 LC_ALL=C tr -d '\r' < fr.po.tmp > fr.po.new
40 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
43 ${DIFF} fr.po fr.po.new || exit 1
45 tmpfiles="$tmpfiles fr"
46 test -d fr || mkdir fr
47 test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
50 ${MSGFMT} -o fr/LC_MESSAGES/cake.mo fr.po
52 tmpfiles="$tmpfiles fr.po.tmp fr.po.un"
53 : ${MSGUNFMT=msgunfmt}
54 ${MSGUNFMT} -o fr.po.tmp fr/LC_MESSAGES/cake.mo
55 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
56 LC_ALL=C tr -d '\r' < fr.po.tmp > fr.po.un
57 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
59 tmpfiles="$tmpfiles fr.po.strip"
60 sed 1,2d < fr.po > fr.po.strip
63 ${DIFF} fr.po.strip fr.po.un || exit 1
65 tmpfiles="$tmpfiles cake.ok cake.tmp cake.out"
67 echo 'un morceau de gateau' > cake.ok
68 LANGUAGE= ./cake fr 1 > cake.tmp || exit 1
69 LC_ALL=C tr -d '\r' < cake.tmp > cake.out || exit 1
70 ${DIFF} cake.ok cake.out || exit 1
71 echo '2 morceaux de gateau' > cake.ok
72 LANGUAGE= ./cake fr 2 > cake.tmp || exit 1
73 LC_ALL=C tr -d '\r' < cake.tmp > cake.out || exit 1
74 ${DIFF} cake.ok cake.out || exit 1
75 echo '10 morceaux de gateau' > cake.ok
76 LANGUAGE= ./cake fr 10 > cake.tmp || exit 1
77 LC_ALL=C tr -d '\r' < cake.tmp > cake.out || exit 1
78 ${DIFF} cake.ok cake.out || exit 1