summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-objc-1
blob: 9563d77745f93d6200924c8ff7c36028e587e910 (plain)
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
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test ObjectiveC extractor.

cat <<\EOF > xg-ob-1.m
id str = _(@
"conca" /* comment */
@
// another comment
 "tenated");

_(@"foo") _ ( @"foo2" /* test */ )

"_()"

"  \" _(foo) \" /* comment "

_ // test
(@ /* comment " */ "test"
@
" test2"
)

NSLocalizedString(@"Information", @"")
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m || exit 1
LC_ALL=C tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po || exit 1

cat <<\EOF > xg-ob-1.ok
#: xg-ob-1.m:2
msgid "concatenated"
msgstr ""

#: xg-ob-1.m:7
msgid "foo"
msgstr ""

#: xg-ob-1.m:7
msgid "foo2"
msgstr ""

#: xg-ob-1.m:14
msgid "test test2"
msgstr ""

#: xg-ob-1.m:19
msgid "Information"
msgstr ""
EOF

: ${DIFF=diff}
${DIFF} xg-ob-1.ok xg-ob-1.po
result=$?

exit $result