Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgfilter-quote-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test 'quot' and 'boldquot' filter.
5
6 cat <<\EOF > mfi.po
7 msgid ""
8 msgstr ""
9 "Project-Id-Version: PACKAGE VERSION\n"
10 "PO-Revision-Date: 2014-04-10 16:40+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=US-ASCII\n"
15 "Content-Transfer-Encoding: 8bit\n"
16
17 msgid "\"double quoted\""
18 msgstr "\"double quoted\""
19
20 msgid "\"\"double quoted\""
21 msgstr "\"\"double quoted\""
22
23 msgid "\"foo\" \"bar\" \"baz\""
24 msgstr "\"foo\" \"bar\" \"baz\""
25
26 msgid "double quoted but empty \"\""
27 msgstr "double quoted but empty \"\""
28
29 msgid "'single quoted'"
30 msgstr "'single quoted'"
31
32 msgid "'foo' 'bar' 'baz'"
33 msgstr "'foo' 'bar' 'baz'"
34
35 msgid "prefix'single quoted without surrounding spaces'suffix"
36 msgstr "prefix'single quoted without surrounding spaces'suffix"
37
38 msgid "prefix 'single quoted with surrounding spaces' suffix"
39 msgstr "prefix 'single quoted with surrounding spaces' suffix"
40
41 msgid "single quoted with apostrophe, empty '' "
42 msgstr "single quoted with apostrophe, empty '' "
43
44 msgid "'single quoted at the beginning of string' "
45 msgstr "'single quoted at the beginning of string' "
46
47 msgid " 'single quoted at the end of string'"
48 msgstr " 'single quoted at the end of string'"
49
50 msgid ""
51 "line 1\n"
52 "'single quoted at the beginning of line' \n"
53 "line 3"
54 msgstr ""
55 "line 1\n"
56 "'single quoted at the beginning of line' \n"
57 "line 3"
58
59 msgid ""
60 "line 1\n"
61 " 'single quoted at the end of line'\n"
62 "line 3"
63 msgstr ""
64 "line 1\n"
65 " 'single quoted at the end of line'\n"
66 "line 3"
67
68 msgid "`single quoted with grave'"
69 msgstr "`single quoted with grave'"
70
71 msgid "single quoted with grave, empty `'"
72 msgstr "single quoted with grave, empty `'"
73
74 msgid "``double grave'"
75 msgstr "``double grave'"
76 EOF
77
78 : ${MSGFILTER=msgfilter}
79 LC_ALL=C ${MSGFILTER} -i mfi.po -o mfi-quot.out quot 2>&1 2>/dev/null || exit 1
80
81 cat <<\EOF > mfi-quot.ok
82 msgid ""
83 msgstr ""
84 "Project-Id-Version: PACKAGE VERSION\n"
85 "PO-Revision-Date: 2014-04-10 16:40+0900\n"
86 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
87 "Language-Team: LANGUAGE <LL@li.org>\n"
88 "MIME-Version: 1.0\n"
89 "Content-Type: text/plain; charset=UTF-8\n"
90 "Content-Transfer-Encoding: 8bit\n"
91
92 msgid "\"double quoted\""
93 msgstr "“double quoted”"
94
95 msgid "\"\"double quoted\""
96 msgstr "\"\"double quoted\""
97
98 msgid "\"foo\" \"bar\" \"baz\""
99 msgstr "“foo” “bar” “baz”"
100
101 msgid "double quoted but empty \"\""
102 msgstr "double quoted but empty \"\""
103
104 msgid "'single quoted'"
105 msgstr "'single quoted'"
106
107 msgid "'foo' 'bar' 'baz'"
108 msgstr "‘foo’ ‘bar’ ‘baz’"
109
110 msgid "prefix'single quoted without surrounding spaces'suffix"
111 msgstr "prefix'single quoted without surrounding spaces'suffix"
112
113 msgid "prefix 'single quoted with surrounding spaces' suffix"
114 msgstr "prefix ‘single quoted with surrounding spaces’ suffix"
115
116 msgid "single quoted with apostrophe, empty '' "
117 msgstr "single quoted with apostrophe, empty ‘’ "
118
119 msgid "'single quoted at the beginning of string' "
120 msgstr "‘single quoted at the beginning of string’ "
121
122 msgid " 'single quoted at the end of string'"
123 msgstr " ‘single quoted at the end of string’"
124
125 msgid ""
126 "line 1\n"
127 "'single quoted at the beginning of line' \n"
128 "line 3"
129 msgstr ""
130 "line 1\n"
131 "‘single quoted at the beginning of line’ \n"
132 "line 3"
133
134 msgid ""
135 "line 1\n"
136 " 'single quoted at the end of line'\n"
137 "line 3"
138 msgstr ""
139 "line 1\n"
140 " ‘single quoted at the end of line’\n"
141 "line 3"
142
143 msgid "`single quoted with grave'"
144 msgstr "‘single quoted with grave’"
145
146 msgid "single quoted with grave, empty `'"
147 msgstr "single quoted with grave, empty ‘’"
148
149 msgid "``double grave'"
150 msgstr "`‘double grave’"
151 EOF
152
153 : ${DIFF=diff}
154 ${DIFF} mfi-quot.ok mfi-quot.out || exit 1
155
156 LC_ALL=C ${MSGFILTER} -i mfi.po -o mfi-boldquot.out boldquot 2>&1 2>/dev/null || exit 1
157
158 cat <<\EOF > mfi-boldquot.ok
159 msgid ""
160 msgstr ""
161 "Project-Id-Version: PACKAGE VERSION\n"
162 "PO-Revision-Date: 2014-04-10 16:40+0900\n"
163 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
164 "Language-Team: LANGUAGE <LL@li.org>\n"
165 "MIME-Version: 1.0\n"
166 "Content-Type: text/plain; charset=UTF-8\n"
167 "Content-Transfer-Encoding: 8bit\n"
168
169 msgid "\"double quoted\""
170 msgstr "“\e[1mdouble quoted\e[0m”"
171
172 msgid "\"\"double quoted\""
173 msgstr "\"\"double quoted\""
174
175 msgid "\"foo\" \"bar\" \"baz\""
176 msgstr "“\e[1mfoo\e[0m” “\e[1mbar\e[0m” “\e[1mbaz\e[0m”"
177
178 msgid "double quoted but empty \"\""
179 msgstr "double quoted but empty \"\""
180
181 msgid "'single quoted'"
182 msgstr "'single quoted'"
183
184 msgid "'foo' 'bar' 'baz'"
185 msgstr "‘\e[1mfoo\e[0m’ ‘\e[1mbar\e[0m’ ‘\e[1mbaz\e[0m’"
186
187 msgid "prefix'single quoted without surrounding spaces'suffix"
188 msgstr "prefix'single quoted without surrounding spaces'suffix"
189
190 msgid "prefix 'single quoted with surrounding spaces' suffix"
191 msgstr "prefix ‘\e[1msingle quoted with surrounding spaces\e[0m’ suffix"
192
193 msgid "single quoted with apostrophe, empty '' "
194 msgstr "single quoted with apostrophe, empty ‘\e[1m\e[0m’ "
195
196 msgid "'single quoted at the beginning of string' "
197 msgstr "‘\e[1msingle quoted at the beginning of string\e[0m’ "
198
199 msgid " 'single quoted at the end of string'"
200 msgstr " ‘\e[1msingle quoted at the end of string\e[0m’"
201
202 msgid ""
203 "line 1\n"
204 "'single quoted at the beginning of line' \n"
205 "line 3"
206 msgstr ""
207 "line 1\n"
208 "‘\e[1msingle quoted at the beginning of line\e[0m’ \n"
209 "line 3"
210
211 msgid ""
212 "line 1\n"
213 " 'single quoted at the end of line'\n"
214 "line 3"
215 msgstr ""
216 "line 1\n"
217 " ‘\e[1msingle quoted at the end of line\e[0m’\n"
218 "line 3"
219
220 msgid "`single quoted with grave'"
221 msgstr "‘\e[1msingle quoted with grave\e[0m’"
222
223 msgid "single quoted with grave, empty `'"
224 msgstr "single quoted with grave, empty ‘\e[1m\e[0m’"
225
226 msgid "``double grave'"
227 msgstr "`‘\e[1mdouble grave\e[0m’"
228 EOF
229
230 ${DIFF} mfi-boldquot.ok mfi-boldquot.out || exit 1