3 # Test plural formula dependent checking of format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 # Take as example a plural formula which takes the values 0 and 2 infinitely
9 # often, and value 1 only a few times.
10 # Test: 1 - have %d everywhere - OK
11 # 2 - lack %d for value 0 - error
12 # 3 - lack %d for value 1 - OK
13 # 4 - lack %d for value 2 - error
15 tmpfiles="$tmpfiles mf-15.po1"
16 cat <<\EOF > mf-15.po1
17 # SOME DESCRIPTIVE TITLE.
18 # Copyright (C) YEAR Free Software Foundation, Inc.
19 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
23 "Project-Id-Version: GNU bison\n"
24 "PO-Revision-Date: 2001-04-05 19:47+0200\n"
25 "Last-Translator: ABC DEF <abc@gnu.uucp>\n"
26 "Language-Team: test <test@li.org>\n"
29 "Content-Type: text/plain; charset=UTF-8\n"
30 "Content-Transfer-Encoding: 8bit\n"
31 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
35 msgid "%d useless nonterminal"
36 msgid_plural "%d useless nonterminals"
37 msgstr[0] "%d unnütze Nichtterminale"
38 msgstr[1] "%d unnützes Nichtterminal"
39 msgstr[2] "%d der unnützen Nichtterminale"
43 ${MSGFMT} --check -o /dev/null mf-15.po1
44 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
46 tmpfiles="$tmpfiles mf-15.po2"
47 cat <<\EOF > mf-15.po2
48 # SOME DESCRIPTIVE TITLE.
49 # Copyright (C) YEAR Free Software Foundation, Inc.
50 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
54 "Project-Id-Version: GNU bison\n"
55 "PO-Revision-Date: 2001-04-05 19:47+0200\n"
56 "Last-Translator: ABC DEF <abc@gnu.uucp>\n"
57 "Language-Team: test <test@li.org>\n"
60 "Content-Type: text/plain; charset=UTF-8\n"
61 "Content-Transfer-Encoding: 8bit\n"
62 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
66 msgid "%d useless nonterminal"
67 msgid_plural "%d useless nonterminals"
68 msgstr[0] "unnütze Nichtterminale"
69 msgstr[1] "%d unnützes Nichtterminal"
70 msgstr[2] "%d der unnützen Nichtterminale"
74 ${MSGFMT} --check -o /dev/null mf-15.po2 2>/dev/null
75 test $? = 1 || { rm -fr $tmpfiles; exit 1; }
77 tmpfiles="$tmpfiles mf-15.po3"
78 cat <<\EOF > mf-15.po3
79 # SOME DESCRIPTIVE TITLE.
80 # Copyright (C) YEAR Free Software Foundation, Inc.
81 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
85 "Project-Id-Version: GNU bison\n"
86 "PO-Revision-Date: 2001-04-05 19:47+0200\n"
87 "Last-Translator: ABC DEF <abc@gnu.uucp>\n"
88 "Language-Team: test <test@li.org>\n"
91 "Content-Type: text/plain; charset=UTF-8\n"
92 "Content-Transfer-Encoding: 8bit\n"
93 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
97 msgid "%d useless nonterminal"
98 msgid_plural "%d useless nonterminals"
99 msgstr[0] "%d unnütze Nichtterminale"
100 msgstr[1] "unnützes Nichtterminal"
101 msgstr[2] "%d der unnützen Nichtterminale"
105 ${MSGFMT} --check -o /dev/null mf-15.po3
106 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
108 tmpfiles="$tmpfiles mf-15.po4"
109 cat <<\EOF > mf-15.po4
110 # SOME DESCRIPTIVE TITLE.
111 # Copyright (C) YEAR Free Software Foundation, Inc.
112 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
116 "Project-Id-Version: GNU bison\n"
117 "PO-Revision-Date: 2001-04-05 19:47+0200\n"
118 "Last-Translator: ABC DEF <abc@gnu.uucp>\n"
119 "Language-Team: test <test@li.org>\n"
121 "MIME-Version: 1.0\n"
122 "Content-Type: text/plain; charset=UTF-8\n"
123 "Content-Transfer-Encoding: 8bit\n"
124 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
128 msgid "%d useless nonterminal"
129 msgid_plural "%d useless nonterminals"
130 msgstr[0] "%d unnütze Nichtterminale"
131 msgstr[1] "%d unnützes Nichtterminal"
132 msgstr[2] "der unnützen Nichtterminale"
136 ${MSGFMT} --check -o /dev/null mf-15.po4 2>/dev/null
137 test $? = 1 || { rm -fr $tmpfiles; exit 1; }