1 #! /bin/sh 2 3 # Test plural formula dependent checking of format strings. 4 5 tmpfiles="" 6 trap 'rm -fr $tmpfiles' 1 2 3 15 7 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 14 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. 20 # 21 msgid "" 22 msgstr "" 23 "Project-Id-Version: GNU bison\n" 24 "PO-Revision-Date: 2001-04-05 19:47+0200\n" 25 "Last-Translator: ABC DEF <abc (at] gnu.uucp>\n" 26 "Language-Team: test <test (at] li.org>\n" 27 "MIME-Version: 1.0\n" 28 "Content-Type: text/plain; charset=UTF-8\n" 29 "Content-Transfer-Encoding: 8bit\n" 30 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n" 31 32 #: src/reduce.c:511 33 #, c-format 34 msgid "%d useless nonterminal" 35 msgid_plural "%d useless nonterminals" 36 msgstr[0] "%d unntze Nichtterminale" 37 msgstr[1] "%d unntzes Nichtterminal" 38 msgstr[2] "%d der unntzen Nichtterminale" 39 EOF 40 41 : ${MSGFMT=msgfmt} 42 ${MSGFMT} --check -o /dev/null mf-15.po1 43 test $? = 0 || { rm -fr $tmpfiles; exit 1; } 44 45 tmpfiles="$tmpfiles mf-15.po2" 46 cat <<\EOF > mf-15.po2 47 # SOME DESCRIPTIVE TITLE. 48 # Copyright (C) YEAR Free Software Foundation, Inc. 49 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 50 # 51 msgid "" 52 msgstr "" 53 "Project-Id-Version: GNU bison\n" 54 "PO-Revision-Date: 2001-04-05 19:47+0200\n" 55 "Last-Translator: ABC DEF <abc (at] gnu.uucp>\n" 56 "Language-Team: test <test (at] li.org>\n" 57 "MIME-Version: 1.0\n" 58 "Content-Type: text/plain; charset=UTF-8\n" 59 "Content-Transfer-Encoding: 8bit\n" 60 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n" 61 62 #: src/reduce.c:511 63 #, c-format 64 msgid "%d useless nonterminal" 65 msgid_plural "%d useless nonterminals" 66 msgstr[0] "unntze Nichtterminale" 67 msgstr[1] "%d unntzes Nichtterminal" 68 msgstr[2] "%d der unntzen Nichtterminale" 69 EOF 70 71 : ${MSGFMT=msgfmt} 72 ${MSGFMT} --check -o /dev/null mf-15.po2 2>/dev/null 73 test $? = 1 || { rm -fr $tmpfiles; exit 1; } 74 75 tmpfiles="$tmpfiles mf-15.po3" 76 cat <<\EOF > mf-15.po3 77 # SOME DESCRIPTIVE TITLE. 78 # Copyright (C) YEAR Free Software Foundation, Inc. 79 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 80 # 81 msgid "" 82 msgstr "" 83 "Project-Id-Version: GNU bison\n" 84 "PO-Revision-Date: 2001-04-05 19:47+0200\n" 85 "Last-Translator: ABC DEF <abc (at] gnu.uucp>\n" 86 "Language-Team: test <test (at] li.org>\n" 87 "MIME-Version: 1.0\n" 88 "Content-Type: text/plain; charset=UTF-8\n" 89 "Content-Transfer-Encoding: 8bit\n" 90 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n" 91 92 #: src/reduce.c:511 93 #, c-format 94 msgid "%d useless nonterminal" 95 msgid_plural "%d useless nonterminals" 96 msgstr[0] "%d unntze Nichtterminale" 97 msgstr[1] "unntzes Nichtterminal" 98 msgstr[2] "%d der unntzen Nichtterminale" 99 EOF 100 101 : ${MSGFMT=msgfmt} 102 ${MSGFMT} --check -o /dev/null mf-15.po3 103 test $? = 0 || { rm -fr $tmpfiles; exit 1; } 104 105 tmpfiles="$tmpfiles mf-15.po4" 106 cat <<\EOF > mf-15.po4 107 # SOME DESCRIPTIVE TITLE. 108 # Copyright (C) YEAR Free Software Foundation, Inc. 109 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 110 # 111 msgid "" 112 msgstr "" 113 "Project-Id-Version: GNU bison\n" 114 "PO-Revision-Date: 2001-04-05 19:47+0200\n" 115 "Last-Translator: ABC DEF <abc (at] gnu.uucp>\n" 116 "Language-Team: test <test (at] li.org>\n" 117 "MIME-Version: 1.0\n" 118 "Content-Type: text/plain; charset=UTF-8\n" 119 "Content-Transfer-Encoding: 8bit\n" 120 "Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n" 121 122 #: src/reduce.c:511 123 #, c-format 124 msgid "%d useless nonterminal" 125 msgid_plural "%d useless nonterminals" 126 msgstr[0] "%d unntze Nichtterminale" 127 msgstr[1] "%d unntzes Nichtterminal" 128 msgstr[2] "der unntzen Nichtterminale" 129 EOF 130 131 : ${MSGFMT=msgfmt} 132 ${MSGFMT} --check -o /dev/null mf-15.po4 2>/dev/null 133 test $? = 1 || { rm -fr $tmpfiles; exit 1; } 134 135 rm -fr $tmpfiles 136 137 exit $result 138