No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / lang-po
blobf5c7ba6ce9c6fd3583853d3ba9b9f2a00fd832ad
1 #! /bin/sh
3 # Test of gettext facilities in the PO/POT format.
5 tmpfiles=""
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."
13 msgstr ""
15 #, c-format
16 msgid "a piece of cake"
17 msgid_plural "%d pieces of cake"
18 msgstr[0] ""
19 msgstr[1] ""
21 #, c-format
22 msgid "%s is replaced by %s."
23 msgstr ""
24 EOF
26 tmpfiles="$tmpfiles prog.pot"
27 : ${XGETTEXT=xgettext}
28 ${XGETTEXT} -o prog.pot --omit-header --add-location prog-in.pot
30 : ${DIFF=diff}
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
37 msgid ""
38 msgstr ""
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.
46 #, c-format
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.
53 #, c-format
54 msgid "%s is replaced by %s."
55 msgstr "%2$s remplace %1$s."
56 EOF
58 tmpfiles="$tmpfiles prog.po"
59 : ${XGETTEXT=xgettext}
60 ${XGETTEXT} -o prog.po --omit-header --add-location prog-in.po
62 : ${DIFF=diff}
63 ${DIFF} prog-in.po prog.po || exit 1
65 rm -fr $tmpfiles
67 exit 0