• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test ObjectiveC extractor.
5
6cat <<\EOF > xg-ob-1.m
7id str = _(@
8"conca" /* comment */
9@
10// another comment
11 "tenated");
12
13_(@"foo") _ ( @"foo2" /* test */ )
14
15"_()"
16
17"  \" _(foo) \" /* comment "
18
19_ // test
20(@ /* comment " */ "test"
21@
22" test2"
23)
24
25NSLocalizedString(@"Information", @"")
26EOF
27
28: ${XGETTEXT=xgettext}
29${XGETTEXT} --omit-header -k_ -kNSLocalizedString -d xg-ob-1.tmp xg-ob-1.m || Exit 1
30LC_ALL=C tr -d '\r' < xg-ob-1.tmp.po > xg-ob-1.po || Exit 1
31
32cat <<\EOF > xg-ob-1.ok
33#: xg-ob-1.m:2
34msgid "concatenated"
35msgstr ""
36
37#: xg-ob-1.m:7
38msgid "foo"
39msgstr ""
40
41#: xg-ob-1.m:7
42msgid "foo2"
43msgstr ""
44
45#: xg-ob-1.m:14
46msgid "test test2"
47msgstr ""
48
49#: xg-ob-1.m:19
50msgid "Information"
51msgstr ""
52EOF
53
54: ${DIFF=diff}
55${DIFF} xg-ob-1.ok xg-ob-1.po
56result=$?
57
58exit $result
59