No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msginit-1
blob1597d2aa3dad021f378be235243a9ae333867c0a
1 #! /bin/sh
3 # Test plural count for locales with nplurals != 2.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles mi-test1.pot"
9 cat <<\EOF > mi-test1.pot
10 # SOME DESCRIPTIVE TITLE.
11 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
12 # This file is distributed under the same license as the PACKAGE package.
13 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
15 #, fuzzy
16 msgid ""
17 msgstr ""
18 "Project-Id-Version: PACKAGE VERSION\n"
19 "Report-Msgid-Bugs-To: \n"
20 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
21 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
22 "Language-Team: LANGUAGE <LL@li.org>\n"
23 "MIME-Version: 1.0\n"
24 "Content-Type: text/plain; charset=CHARSET\n"
25 "Content-Transfer-Encoding: 8bit\n"
27 #, c-format
28 msgid "'Your command, please?', asked the waiter."
29 msgstr ""
31 #, c-format
32 msgid "a piece of cake"
33 msgid_plural "%d pieces of cake"
34 msgstr[0] ""
35 msgstr[1] ""
37 #, c-format
38 msgid "%s is replaced by %s."
39 msgstr ""
40 EOF
42 tmpfiles="$tmpfiles mi-test1.tmp mi-test1.out mi-test1.err"
43 : ${MSGINIT=msginit}
44 ${MSGINIT} -i mi-test1.pot -l ga_IE --no-translator -o mi-test1.tmp 2>mi-test1.err
45 test $? = 0 || { cat mi-test1.err 1>&2; rm -fr $tmpfiles; exit 1; }
46 sed -e '1,15d' < mi-test1.tmp > mi-test1.out
47 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
49 tmpfiles="$tmpfiles mi-test1.ok"
50 cat <<\EOF > mi-test1.ok
51 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
53 #, c-format
54 msgid "'Your command, please?', asked the waiter."
55 msgstr ""
57 #, c-format
58 msgid "a piece of cake"
59 msgid_plural "%d pieces of cake"
60 msgstr[0] ""
61 msgstr[1] ""
62 msgstr[2] ""
64 #, c-format
65 msgid "%s is replaced by %s."
66 msgstr ""
67 EOF
69 : ${DIFF=diff}
70 ${DIFF} mi-test1.ok mi-test1.out
71 result=$?
73 rm -fr $tmpfiles
75 exit $result