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