2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test msgexec on a PO file with plurals.
6 cat <<\EOF > mex-test5.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."
31 cat <<\EOF > mex-test5.sh
33 echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
34 if test -n "${MSGEXEC_MSGCTXT+set}"; then
35 echo "context: $MSGEXEC_MSGCTXT" | LC_ALL=C tr -d '\r'
42 $MSGEXEC_PREV_MSGID_PLURAL
46 echo | LC_ALL=C tr -d '\r'
49 chmod a+x mex-test5.sh
53 ${MSGEXEC} -i mex-test5.po ./mex-test5.sh > mex-test5.out 2> mex-test5.err
55 cat mex-test5.err | grep -v 'warning: Locale charset' | grep -v '^ '
56 test $result = 0 || { exit 1; }
58 cat <<\EOF > mex-test5.ok
59 ========================= mex-test5.po:2 =========================
66 Content-Type: text/plain; charset=ASCII
67 Plural-Forms: nplurals=2; plural=(n > 1);
69 ========================= mex-test5.po:8 =========================
70 'Your command, please?', asked the waiter.
76 'Votre commande, s'il vous plait', dit le garcon.
77 ========================= mex-test5.po:16 =========================
85 ========================= mex-test5.po:16 =========================
93 ========================= mex-test5.po:22 =========================
104 ${DIFF} mex-test5.ok mex-test5.out