2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test msgfilter on a PO file with plurals.
6 cat <<\EOF > mf-test6.po
9 "Content-Type: text/plain; charset=ASCII\n"
10 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
13 msgid "'Your command, please?', asked the waiter."
14 msgstr "'Votre commande, s'il vous plait', dit le garcon."
16 # Les gateaux allemands sont les meilleurs du monde.
18 #| msgid "a piece of bread"
19 #| msgid_plural "%d pieces of bread"
20 msgid "a piece of cake"
21 msgid_plural "%d pieces of cake"
22 msgstr[0] "un morceau de gateau"
23 msgstr[1] "%d morceaux de gateau"
25 # Reverse the arguments.
27 msgid "%s is replaced by %s."
28 msgstr "%2$s remplace %1$s."
33 cat <<\EOF > mf-test6.sh
35 echo "========================= $MSGFILTER_LOCATION =========================" >> mf-test6.tmp
36 if test -n "${MSGFILTER_MSGCTXT+set}"; then
37 echo "context: $MSGFILTER_MSGCTXT" >> mf-test6.tmp
39 cat >> mf-test6.tmp <<MEOF
41 $MSGFILTER_MSGID_PLURAL
42 $MSGFILTER_PLURAL_FORM
44 $MSGFILTER_PREV_MSGID_PLURAL
50 : ${MSGFILTER=msgfilter}
52 ${MSGFILTER} -i mf-test6.po ./mf-test6.sh >/dev/null 2> mf-test6.err
55 cat mf-test6.err | grep -v 'warning: Locale charset' | grep -v '^ '
56 test $result = 0 || { exit 1; }
58 LC_ALL=C tr -d '\r' < mf-test6.tmp > mf-test6.out
60 cat <<\EOF > mf-test6.ok
61 ========================= mf-test6.po:2 =========================
67 ========================= mf-test6.po:8 =========================
68 'Your command, please?', asked the waiter.
73 ========================= mf-test6.po:16 =========================
79 ========================= mf-test6.po:16 =========================
85 ========================= mf-test6.po:22 =========================
94 ${DIFF} mf-test6.ok mf-test6.out