#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test of JavaScript support.
# Playing with concatenation of string literals within the gettext function
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles xg-js-3.js"
cat <<\EOF > xg-js-3.js
// The usual way to concatenate strings is the plus '+' sign
var s1 = _("Concatenation #1 " + "- String part added");
' should' + " be " + 'extracted');
EOF
-tmpfiles="$tmpfiles xg-js-3.err xg-js-3.tmp xg-js-3.pot"
: ${XGETTEXT=xgettext}
-${XGETTEXT} --add-comments --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err
-test $? = 0 || { cat xg-js-3.err; rm -fr $tmpfiles; exit 1; }
+${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err
+test $? = 0 || { cat xg-js-3.err; exit 1; }
# Don't simplify this to "grep ... < xg-js-3.tmp", otherwise OpenBSD 4.0 grep
# only outputs "Binary file (standard input) matches".
cat xg-js-3.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-3.pot
-tmpfiles="$tmpfiles xg-js-3.ok"
cat <<\EOF > xg-js-3.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
${DIFF} xg-js-3.ok xg-js-3.pot
result=$?
-rm -fr $tmpfiles
-
exit $result