No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / lang-ycp
blob8dcbc616580a444416a44347863f811e9fc819fd
1 #! /bin/sh
3 # Test of gettext facilities in the YCP language.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles prog.ycp"
9 cat <<\EOF > prog.ycp
11 textdomain "prog";
13 print (_("'Your command, please?', asked the waiter."));
14 print (sformat (_("a piece of cake", "%1 pieces of cake", n), n));
15 print (sformat (_("%1 is replaced by %2."), "FF", "EUR"));
17 EOF
19 tmpfiles="$tmpfiles prog.pot"
20 : ${XGETTEXT=xgettext}
21 ${XGETTEXT} -o prog.pot --omit-header --no-location prog.ycp
23 tmpfiles="$tmpfiles prog.ok"
24 cat <<EOF > prog.ok
25 msgid "'Your command, please?', asked the waiter."
26 msgstr ""
28 #, ycp-format
29 msgid "a piece of cake"
30 msgid_plural "%1 pieces of cake"
31 msgstr[0] ""
32 msgstr[1] ""
34 #, ycp-format
35 msgid "%1 is replaced by %2."
36 msgstr ""
37 EOF
39 : ${DIFF=diff}
40 ${DIFF} prog.ok prog.pot || exit 1
42 tmpfiles="$tmpfiles fr.po"
43 cat <<\EOF > fr.po
44 msgid ""
45 msgstr ""
46 "Content-Type: text/plain; charset=ISO-8859-1\n"
47 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
49 msgid "'Your command, please?', asked the waiter."
50 msgstr "«Votre commande, s'il vous plait», dit le garçon."
52 # Les gateaux allemands sont les meilleurs du monde.
53 #, ycp-format
54 msgid "a piece of cake"
55 msgid_plural "%1 pieces of cake"
56 msgstr[0] "un morceau de gateau"
57 msgstr[1] "%1 morceaux de gateau"
59 # Reverse the arguments.
60 #, ycp-format
61 msgid "%1 is replaced by %2."
62 msgstr "%2 remplace %1."
63 EOF
65 tmpfiles="$tmpfiles fr.po.new"
66 : ${MSGMERGE=msgmerge}
67 ${MSGMERGE} -q -o fr.po.new fr.po prog.pot
69 : ${DIFF=diff}
70 ${DIFF} fr.po fr.po.new || exit 1
72 rm -fr $tmpfiles
74 exit 0