• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#! /bin/sh
2
3# Test plural formula dependent checking of format strings.
4
5tmpfiles=""
6trap '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
15tmpfiles="$tmpfiles mf-15.po1"
16cat <<\EOF > mf-15.po1
17# SOME DESCRIPTIVE TITLE.
18# Copyright (C) YEAR Free Software Foundation, Inc.
19# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
20#
21msgid ""
22msgstr ""
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"
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
34msgid "%d useless nonterminal"
35msgid_plural "%d useless nonterminals"
36msgstr[0] "%d unn��tze Nichtterminale"
37msgstr[1] "%d unn��tzes Nichtterminal"
38msgstr[2] "%d der unn��tzen Nichtterminale"
39EOF
40
41: ${MSGFMT=msgfmt}
42${MSGFMT} --check -o /dev/null mf-15.po1
43test $? = 0 || { rm -fr $tmpfiles; exit 1; }
44
45tmpfiles="$tmpfiles mf-15.po2"
46cat <<\EOF > mf-15.po2
47# SOME DESCRIPTIVE TITLE.
48# Copyright (C) YEAR Free Software Foundation, Inc.
49# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
50#
51msgid ""
52msgstr ""
53"Project-Id-Version: GNU bison\n"
54"PO-Revision-Date: 2001-04-05 19:47+0200\n"
55"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
56"Language-Team: test <test@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
64msgid "%d useless nonterminal"
65msgid_plural "%d useless nonterminals"
66msgstr[0] "unn��tze Nichtterminale"
67msgstr[1] "%d unn��tzes Nichtterminal"
68msgstr[2] "%d der unn��tzen Nichtterminale"
69EOF
70
71: ${MSGFMT=msgfmt}
72${MSGFMT} --check -o /dev/null mf-15.po2 2>/dev/null
73test $? = 1 || { rm -fr $tmpfiles; exit 1; }
74
75tmpfiles="$tmpfiles mf-15.po3"
76cat <<\EOF > mf-15.po3
77# SOME DESCRIPTIVE TITLE.
78# Copyright (C) YEAR Free Software Foundation, Inc.
79# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
80#
81msgid ""
82msgstr ""
83"Project-Id-Version: GNU bison\n"
84"PO-Revision-Date: 2001-04-05 19:47+0200\n"
85"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
86"Language-Team: test <test@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
94msgid "%d useless nonterminal"
95msgid_plural "%d useless nonterminals"
96msgstr[0] "%d unn��tze Nichtterminale"
97msgstr[1] "unn��tzes Nichtterminal"
98msgstr[2] "%d der unn��tzen Nichtterminale"
99EOF
100
101: ${MSGFMT=msgfmt}
102${MSGFMT} --check -o /dev/null mf-15.po3
103test $? = 0 || { rm -fr $tmpfiles; exit 1; }
104
105tmpfiles="$tmpfiles mf-15.po4"
106cat <<\EOF > mf-15.po4
107# SOME DESCRIPTIVE TITLE.
108# Copyright (C) YEAR Free Software Foundation, Inc.
109# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
110#
111msgid ""
112msgstr ""
113"Project-Id-Version: GNU bison\n"
114"PO-Revision-Date: 2001-04-05 19:47+0200\n"
115"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
116"Language-Team: test <test@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
124msgid "%d useless nonterminal"
125msgid_plural "%d useless nonterminals"
126msgstr[0] "%d unn��tze Nichtterminale"
127msgstr[1] "%d unn��tzes Nichtterminal"
128msgstr[2] "der unn��tzen Nichtterminale"
129EOF
130
131: ${MSGFMT=msgfmt}
132${MSGFMT} --check -o /dev/null mf-15.po4 2>/dev/null
133test $? = 1 || { rm -fr $tmpfiles; exit 1; }
134
135rm -fr $tmpfiles
136
137exit $result
138