Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcmp-4
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test comparison with PO files with previous msgids.
5 # Test --use-fuzzy option.
6
7 cat <<\EOF > mc-test4.pot
8 # SOME DESCRIPTIVE TITLE.
9 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
10 # This file is distributed under the same license as the PACKAGE package.
11 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
12 #
13 #, fuzzy
14 msgid ""
15 msgstr ""
16 "Project-Id-Version: PACKAGE VERSION\n"
17 "Report-Msgid-Bugs-To: \n"
18 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
19 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
20 "Language-Team: LANGUAGE <LL@li.org>\n"
21 "MIME-Version: 1.0\n"
22 "Content-Type: text/plain; charset=UTF-8\n"
23 "Content-Transfer-Encoding: 8bit\n"
24
25 #. TRANSLATORS: An error message.
26 #: src/args.c:242
27 #, c-format
28 msgid "Too many arguments."
29 msgstr ""
30
31 #. TRANSLATORS: An error message.
32 #: src/args.c:247
33 #, c-format
34 msgid "Too few arguments."
35 msgstr ""
36
37 # Oder besser "fehlende Argumente"?
38 #. TRANSLATORS: An error message.
39 #: src/args.c:273
40 #, c-format
41 msgid "Missing arguments."
42 msgstr ""
43 EOF
44
45 cat <<\EOF > mc-test4.po1
46 msgid ""
47 msgstr ""
48 "Report-Msgid-Bugs-To: \n"
49 "Content-Type: text/plain; charset=UTF-8\n"
50 "Content-Transfer-Encoding: 8bit\n"
51
52 #. TRANSLATORS: An error message.
53 #: src/args.c:242
54 #, fuzzy, c-format
55 #| msgid "too many arguments"
56 msgid "Too many arguments."
57 msgstr "zu viele Argumente"
58
59 #. TRANSLATORS: An error message.
60 #: src/args.c:247
61 #, fuzzy, c-format
62 #| msgid "too many arguments"
63 msgid "Too few arguments."
64 msgstr "zu viele Argumente"
65
66 # Oder besser "fehlende Argumente"?
67 #. TRANSLATORS: An error message.
68 #: src/args.c:273
69 #, fuzzy, c-format
70 #| msgid "missing arguments"
71 msgid "Missing arguments."
72 msgstr "Argumente fehlen"
73
74 #: getopt.c:796 getopt.c:799
75 #, fuzzy, c-format
76 #| msgid "%s: invalid option -- %c\n"
77 msgid "%s: illegal option -- %c\n"
78 msgstr "%s: ungültige Option -- %c\n"
79
80 #: getopt.c:805 getopt.c:808
81 #, c-format
82 msgid "%s: invalid option -- %c\n"
83 msgstr "%s: ungültige Option -- %c\n"
84 EOF
85
86 # Verify that with fuzzies, all msgids of the POT file are covered.
87 : ${MSGCMP=msgcmp}
88 LC_MESSAGES=C LC_ALL= \
89 ${MSGCMP} --use-fuzzy mc-test4.po1 mc-test4.pot > mc-test4.out11 2>&1 || exit 1
90 if grep -v 'warning:' mc-test4.out11 > /dev/null; then
91   exit 1;
92 fi
93
94 # Verify that without fuzzies, not all msgids of the POT file are covered.
95 : ${MSGCMP=msgcmp}
96 LC_MESSAGES=C LC_ALL= \
97 ${MSGCMP} mc-test4.po1 mc-test4.pot > mc-test4.out12 2>&1
98 test $? = 1 || { exit 1; }
99 grep -v 'warning:' mc-test4.out12 > /dev/null || exit 1
100
101 cat <<\EOF > mc-test4.po2
102 msgid ""
103 msgstr ""
104 "Report-Msgid-Bugs-To: \n"
105 "Content-Type: text/plain; charset=UTF-8\n"
106 "Content-Transfer-Encoding: 8bit\n"
107
108 #. TRANSLATORS: An error message.
109 #: src/args.c:242
110 #, c-format
111 #| msgid "too many arguments"
112 msgid "Too many arguments."
113 msgstr "Zu viele Argumente."
114
115 #. TRANSLATORS: An error message.
116 #: src/args.c:247
117 #, c-format
118 #| msgid "too many arguments"
119 msgid "Too few arguments."
120 msgstr "Zu wenige Argumente."
121
122 # Oder besser "fehlende Argumente"?
123 #. TRANSLATORS: An error message.
124 #: src/args.c:273
125 #, c-format
126 #| msgid "missing arguments"
127 msgid "Missing arguments."
128 msgstr "Argumente fehlen."
129
130 #: getopt.c:796 getopt.c:799
131 #, fuzzy, c-format
132 #| msgid "%s: invalid option -- %c\n"
133 msgid "%s: illegal option -- %c\n"
134 msgstr "%s: ungültige Option -- %c\n"
135
136 #: getopt.c:805 getopt.c:808
137 #, c-format
138 msgid "%s: invalid option -- %c\n"
139 msgstr "%s: ungültige Option -- %c\n"
140 EOF
141
142 # Verify that without fuzzies, all msgids of the POT file are covered.
143 # Verify that previous msgids are ignored even when specified on non-fuzzy
144 # messages.
145 : ${MSGCMP=msgcmp}
146 LC_MESSAGES=C LC_ALL= \
147 ${MSGCMP} mc-test4.po2 mc-test4.pot > mc-test4.out2 2>&1 || exit 1
148 if grep -v 'warning:' mc-test4.out2 > /dev/null; then
149   exit 1;
150 fi
151
152 exit $result