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

# Test Scheme support: --add-comments option.

cat <<EOF > xg-sc-1.scm
; This comment will not be extracted.
(display (_ "help"))
;;  TRANSLATORS: This is an extracted comment.
(display (_ "me"))
#!  Not extracted either.
!#
(display (_ "The Fabulous Four"))
EOF

: ${XGETTEXT=xgettext}
${XGETTEXT} -k_ --omit-header --no-location --add-comments=TRANSLATORS: \
  -d xg-sc-1.tmp xg-sc-1.scm || exit 1
LC_ALL=C tr -d '\r' < xg-sc-1.tmp.po > xg-sc-1.po || exit 1

cat <<EOF > xg-sc-1.ok
msgid "help"
msgstr ""

#. TRANSLATORS: This is an extracted comment.
msgid "me"
msgstr ""

msgid "The Fabulous Four"
msgstr ""
EOF

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

exit $result