File: xgettext-java-8

package info (click to toggle)
gettext 0.23.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 168,104 kB
  • sloc: ansic: 532,579; sh: 68,252; perl: 28,011; makefile: 9,066; lisp: 3,184; yacc: 1,055; java: 615; cs: 589; cpp: 397; objc: 343; sed: 79; tcl: 63; xml: 40; pascal: 11; php: 7; awk: 7
file content (343 lines) | stat: -rw-r--r-- 6,313 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test Java support: formatted and format strings.

: ${XGETTEXT=xgettext}

cat <<\EOF > xg-j-8.java
"<b>%s</b>".formatted(_("Hello 1"));
_("Explanation: %s").formatted(_("Hello 2"));
_("test case 1");
_("test case 2").formatted();
(_("test case 3"));
(_("test case 4")).formatted();
((_("test case 5")));
((_("test case 6"))).formatted();
return _("test case 10");
return _("test case 11").formatted();
return (_("test case 12").formatted());
return (_("test case 13")).formatted();
foo (_("test case 15"));
foo (_("test case 16")).formatted();
(foo (_("test case 17"))).formatted();
(foo (_("test case 18")).formatted());
foo (_("test case 19").formatted());
foo + _("test case 20");
foo + _("test case 21").formatted();
(foo + _("test case 22")).formatted();
_("test case 23") + foo;
_("test case 24").formatted() + foo;
(_("test case 25") + foo).formatted();
_("test case 26 a") + _("test case 26 b");
_("test case 27 a").formatted() + _("test case 27 b");
_("test case 28 a") + _("test case 28 b").formatted();
_("test case 29 a").formatted() + _("test case 29 b").formatted();
(_("test case 30 a") + _("test case 30 b")).formatted();
return _("test case 31 a") + _("test case 31 b");
return _("test case 32 a").formatted() + _("test case 32 b");
return _("test case 33 a") + _("test case 33 b").formatted();
return _("test case 34 a").formatted() + _("test case 34 b").formatted();
return (_("test case 35 a") + _("test case 35 b")).formatted();
return _("test case 36 a") + (_("test case 36 b")).formatted() + _("test case 36 c").formatted();
return _("test case 37 a") + _("test case 37 b").formatted() + (_("test case 37 c")).formatted();
return _("test case 38 a") + (_("test case 38 b")).formatted() + (_("test case 38 c")).formatted();
foo ? _("test case 40 a") : _("test case 40 b");
foo ? _("test case 41 a").formatted() : _("test case 41 b");
foo ? _("test case 42 a") : _("test case 42 b").formatted();
foo ? _("test case 43 a").formatted() : _("test case 43 b").formatted();
(foo ? _("test case 44 a") : _("test case 44 b"));
(foo ? _("test case 45 a") : _("test case 45 b")).formatted();
s = (_("test case 46")).formatted();
(s = _("test case 47")).formatted();
s += (_("test case 48")).formatted();
(s += _("test case 49")).formatted();
return _("test case 50 a")
       + _("test case 50 b").formatted()
       + (_("test case 50 c")).formatted()
       + foo(_("test case 50 d")).formatted()
       + (b ? _("test case 50 e") : _("test case 50 f")).formatted()
       + (b ? foo + _("test case 50 g") : _("test case 50 h") + bar).formatted();
EOF

${XGETTEXT} --omit-header --no-location \
            -k_ --flag=_:1:pass-java-format --flag=_:1:pass-java-printf-format \
            -o xg-j-8.tmp xg-j-8.java \
  || Exit 1
func_filter_POT_Creation_Date xg-j-8.tmp xg-j-8.po

cat <<\EOF > xg-j-8.ok
msgid "Hello 1"
msgstr ""

#, java-printf-format
msgid "Explanation: %s"
msgstr ""

msgid "Hello 2"
msgstr ""

msgid "test case 1"
msgstr ""

#, java-printf-format
msgid "test case 2"
msgstr ""

msgid "test case 3"
msgstr ""

#, java-printf-format
msgid "test case 4"
msgstr ""

msgid "test case 5"
msgstr ""

#, java-printf-format
msgid "test case 6"
msgstr ""

msgid "test case 10"
msgstr ""

#, java-printf-format
msgid "test case 11"
msgstr ""

#, java-printf-format
msgid "test case 12"
msgstr ""

#, java-printf-format
msgid "test case 13"
msgstr ""

msgid "test case 15"
msgstr ""

msgid "test case 16"
msgstr ""

msgid "test case 17"
msgstr ""

msgid "test case 18"
msgstr ""

#, java-printf-format
msgid "test case 19"
msgstr ""

msgid "test case 20"
msgstr ""

#, java-printf-format
msgid "test case 21"
msgstr ""

msgid "test case 22"
msgstr ""

msgid "test case 23"
msgstr ""

#, java-printf-format
msgid "test case 24"
msgstr ""

msgid "test case 25"
msgstr ""

msgid "test case 26 a"
msgstr ""

msgid "test case 26 b"
msgstr ""

#, java-printf-format
msgid "test case 27 a"
msgstr ""

msgid "test case 27 b"
msgstr ""

msgid "test case 28 a"
msgstr ""

#, java-printf-format
msgid "test case 28 b"
msgstr ""

#, java-printf-format
msgid "test case 29 a"
msgstr ""

#, java-printf-format
msgid "test case 29 b"
msgstr ""

msgid "test case 30 a"
msgstr ""

msgid "test case 30 b"
msgstr ""

msgid "test case 31 a"
msgstr ""

msgid "test case 31 b"
msgstr ""

#, java-printf-format
msgid "test case 32 a"
msgstr ""

msgid "test case 32 b"
msgstr ""

msgid "test case 33 a"
msgstr ""

#, java-printf-format
msgid "test case 33 b"
msgstr ""

#, java-printf-format
msgid "test case 34 a"
msgstr ""

#, java-printf-format
msgid "test case 34 b"
msgstr ""

msgid "test case 35 a"
msgstr ""

msgid "test case 35 b"
msgstr ""

msgid "test case 36 a"
msgstr ""

#, java-printf-format
msgid "test case 36 b"
msgstr ""

#, java-printf-format
msgid "test case 36 c"
msgstr ""

msgid "test case 37 a"
msgstr ""

#, java-printf-format
msgid "test case 37 b"
msgstr ""

#, java-printf-format
msgid "test case 37 c"
msgstr ""

msgid "test case 38 a"
msgstr ""

#, java-printf-format
msgid "test case 38 b"
msgstr ""

#, java-printf-format
msgid "test case 38 c"
msgstr ""

msgid "test case 40 a"
msgstr ""

msgid "test case 40 b"
msgstr ""

#, java-printf-format
msgid "test case 41 a"
msgstr ""

msgid "test case 41 b"
msgstr ""

msgid "test case 42 a"
msgstr ""

#, java-printf-format
msgid "test case 42 b"
msgstr ""

#, java-printf-format
msgid "test case 43 a"
msgstr ""

#, java-printf-format
msgid "test case 43 b"
msgstr ""

msgid "test case 44 a"
msgstr ""

msgid "test case 44 b"
msgstr ""

#, java-printf-format
msgid "test case 45 a"
msgstr ""

#, java-printf-format
msgid "test case 45 b"
msgstr ""

#, java-printf-format
msgid "test case 46"
msgstr ""

#, java-printf-format
msgid "test case 47"
msgstr ""

#, java-printf-format
msgid "test case 48"
msgstr ""

msgid "test case 49"
msgstr ""

msgid "test case 50 a"
msgstr ""

#, java-printf-format
msgid "test case 50 b"
msgstr ""

#, java-printf-format
msgid "test case 50 c"
msgstr ""

msgid "test case 50 d"
msgstr ""

#, java-printf-format
msgid "test case 50 e"
msgstr ""

#, java-printf-format
msgid "test case 50 f"
msgstr ""

msgid "test case 50 g"
msgstr ""

msgid "test case 50 h"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-j-8.ok xg-j-8.po
result=$?

exit $result