3 # Test of gettext facilities in the PO/POT format.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 # Test with POT format.
10 tmpfiles
="$tmpfiles prog-in.pot"
11 cat <<\EOF
> prog-in.pot
12 msgid
"'Your command, please?', asked the waiter."
16 msgid
"a piece of cake"
17 msgid_plural
"%d pieces of cake"
22 msgid
"%s is replaced by %s."
26 tmpfiles
="$tmpfiles prog.pot"
27 : ${XGETTEXT=xgettext}
28 ${XGETTEXT} -o prog.pot
--omit-header --add-location prog-in.pot
31 ${DIFF} prog-in.pot prog.pot ||
exit 1
33 # Test with PO format.
35 tmpfiles
="$tmpfiles prog-in.po"
36 cat <<\EOF
> prog-in.po
39 "Content-Type: text/plain; charset=ISO-8859-1\n"
40 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
42 msgid
"'Your command, please?', asked the waiter."
43 msgstr
"«Votre commande, s'il vous plait», dit le garçon."
45 # Les gateaux allemands sont les meilleurs du monde.
47 msgid
"a piece of cake"
48 msgid_plural
"%d pieces of cake"
49 msgstr
[0] "un morceau de gateau"
50 msgstr
[1] "%d morceaux de gateau"
52 # Reverse the arguments.
54 msgid
"%s is replaced by %s."
55 msgstr
"%2$s remplace %1$s."
58 tmpfiles
="$tmpfiles prog.po"
59 : ${XGETTEXT=xgettext}
60 ${XGETTEXT} -o prog.po
--omit-header --add-location prog-in.po
63 ${DIFF} prog-in.po prog.po ||
exit 1