Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msginit-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test plural count for locales with nplurals != 2.
5
6 cat <<\EOF > mi-test1.pot
7 # SOME DESCRIPTIVE TITLE.
8 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
9 # This file is distributed under the same license as the PACKAGE package.
10 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
11 #
12 #, fuzzy
13 msgid ""
14 msgstr ""
15 "Project-Id-Version: PACKAGE VERSION\n"
16 "Report-Msgid-Bugs-To: \n"
17 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
18 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
19 "Language-Team: LANGUAGE <LL@li.org>\n"
20 "Language: \n"
21 "MIME-Version: 1.0\n"
22 "Content-Type: text/plain; charset=CHARSET\n"
23 "Content-Transfer-Encoding: 8bit\n"
24
25 #, c-format
26 msgid "'Your command, please?', asked the waiter."
27 msgstr ""
28
29 #, c-format
30 msgid "a piece of cake"
31 msgid_plural "%d pieces of cake"
32 msgstr[0] ""
33 msgstr[1] ""
34
35 #, c-format
36 msgid "%s is replaced by %s."
37 msgstr ""
38 EOF
39
40 : ${MSGINIT=msginit}
41 ${MSGINIT} -i mi-test1.pot -l ga_IE --no-translator -o mi-test1.tmp 2>mi-test1.err
42 test $? = 0 || { cat mi-test1.err 1>&2; exit 1; }
43 # The charset stored in the header entry is the locale encoding of the gl_IE
44 # locale, which is system dependent, or ASCII if the locale does not exist.
45 sed -e '1,10d' -e 's/\(ISO-8859-1\|CP1252\|UTF-8\)/ASCII/g' < mi-test1.tmp | LC_ALL=C tr -d '\r' > mi-test1.out || exit 1
46
47 cat <<\EOF > mi-test1.ok
48 "Last-Translator: Automatically generated\n"
49 "Language-Team: none\n"
50 "Language: ga\n"
51 "MIME-Version: 1.0\n"
52 "Content-Type: text/plain; charset=ASCII\n"
53 "Content-Transfer-Encoding: 8bit\n"
54 "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2;\n"
55
56 #, c-format
57 msgid "'Your command, please?', asked the waiter."
58 msgstr ""
59
60 #, c-format
61 msgid "a piece of cake"
62 msgid_plural "%d pieces of cake"
63 msgstr[0] ""
64 msgstr[1] ""
65 msgstr[2] ""
66
67 #, c-format
68 msgid "%s is replaced by %s."
69 msgstr ""
70 EOF
71
72 : ${DIFF=diff}
73 ${DIFF} mi-test1.ok mi-test1.out
74 result=$?
75
76 exit $result