1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test Tcl support: --add-comments option.
5
6cat <<EOF > xg-t-2.tcl
7# This comment will not be extracted.
8puts [_ "help"]
9#  TRANSLATORS: This is an extracted comment.
10puts [_ "me"]
11# Not extracted either.
12puts [_ "Hey Jude"]
13# TRANSLATORS:
14#    Nickname of the Beatles
15puts [_ "The Fabulous Four"]
16EOF
17
18: ${XGETTEXT=xgettext}
19${XGETTEXT} --omit-header --no-location --add-comments=TRANSLATORS: -k_ \
20  -d xg-t-2.tmp xg-t-2.tcl || Exit 1
21LC_ALL=C tr -d '\r' < xg-t-2.tmp.po > xg-t-2.po || Exit 1
22
23cat <<EOF > xg-t-2.ok
24msgid "help"
25msgstr ""
26
27#. TRANSLATORS: This is an extracted comment.
28msgid "me"
29msgstr ""
30
31msgid "Hey Jude"
32msgstr ""
33
34#. TRANSLATORS:
35#. Nickname of the Beatles
36msgid "The Fabulous Four"
37msgstr ""
38EOF
39
40: ${DIFF=diff}
41${DIFF} xg-t-2.ok xg-t-2.po
42result=$?
43
44exit $result
45