No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / plural-1
blob23537f2d7e6215b59c2815a3b6a48c13710e74b7
1 #! /bin/sh
3 tmpfiles=""
4 trap 'rm -fr $tmpfiles' 1 2 3 15
6 tmpfiles="$tmpfiles cake.pot"
7 : ${XGETTEXT=xgettext}
8 ${XGETTEXT} -o cake.pot --omit-header --no-location ${top_srcdir}/tests/plural-1-prg.c
10 tmpfiles="$tmpfiles cake.ok"
11 cat <<EOF > cake.ok
12 #, c-format
13 msgid "a piece of cake"
14 msgid_plural "%d pieces of cake"
15 msgstr[0] ""
16 msgstr[1] ""
17 EOF
19 : ${DIFF=diff}
20 ${DIFF} cake.ok cake.pot || exit 1
22 tmpfiles="$tmpfiles fr.po"
23 cat <<EOF > fr.po
24 # Les gateaux allemands sont les meilleurs du monde.
25 #, c-format
26 msgid "a piece of cake"
27 msgid_plural "%d pieces of cake"
28 msgstr[0] "un morceau de gateau"
29 msgstr[1] "%d morceaux de gateau"
30 EOF
32 tmpfiles="$tmpfiles fr.po.new"
33 : ${MSGMERGE=msgmerge}
34 ${MSGMERGE} -q -o fr.po.new fr.po cake.pot
36 : ${DIFF=diff}
37 ${DIFF} fr.po fr.po.new || exit 1
39 tmpfiles="$tmpfiles fr"
40 test -d fr || mkdir fr
41 test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
43 : ${MSGFMT=msgfmt}
44 ${MSGFMT} -o fr/LC_MESSAGES/cake.mo fr.po
46 tmpfiles="$tmpfiles fr.po.tmp"
47 : ${MSGUNFMT=msgunfmt}
48 ${MSGUNFMT} fr/LC_MESSAGES/cake.mo -o fr.po.tmp
50 tmpfiles="$tmpfiles fr.po.strip"
51 sed 1,2d < fr.po > fr.po.strip
53 : ${DIFF=diff}
54 ${DIFF} fr.po.strip fr.po.tmp || exit 1
56 tmpfiles="$tmpfiles cake.ok cake.out"
57 : ${DIFF=diff}
58 echo 'un morceau de gateau' > cake.ok
59 LANGUAGE= ./cake fr 1 > cake.out || exit 1
60 ${DIFF} cake.ok cake.out || exit 1
61 echo '2 morceaux de gateau' > cake.ok
62 LANGUAGE= ./cake fr 2 > cake.out || exit 1
63 ${DIFF} cake.ok cake.out || exit 1
64 echo '10 morceaux de gateau' > cake.ok
65 LANGUAGE= ./cake fr 10 > cake.out || exit 1
66 ${DIFF} cake.ok cake.out || exit 1
68 rm -fr $tmpfiles
70 exit 0