2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of JavaScript support.
5 # Playing with concatenation of string literals within the gettext function
7 cat <<\EOF > xg-js-3.js
8 // The usual way to concatenate strings is the plus '+' sign
9 var s1 = _("Concatenation #1 " + "- String part added");
10 var s2 = _('Concatenation #2 ' + '- String part added');
11 var s3 = _("This" + " whole "
13 ' should' + " be " + 'extracted');
16 : ${XGETTEXT=xgettext}
17 ${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err
18 test $? = 0 || { cat xg-js-3.err; exit 1; }
19 # Don't simplify this to "grep ... < xg-js-3.tmp", otherwise OpenBSD 4.0 grep
20 # only outputs "Binary file (standard input) matches".
21 cat xg-js-3.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-3.pot
23 cat <<\EOF > xg-js-3.ok
24 # SOME DESCRIPTIVE TITLE.
25 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
26 # This file is distributed under the same license as the PACKAGE package.
27 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
32 "Project-Id-Version: PACKAGE VERSION\n"
33 "Report-Msgid-Bugs-To: \n"
34 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
35 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
36 "Language-Team: LANGUAGE <LL@li.org>\n"
39 "Content-Type: text/plain; charset=CHARSET\n"
40 "Content-Transfer-Encoding: 8bit\n"
42 msgid "Concatenation #1 - String part added"
45 msgid "Concatenation #2 - String part added"
48 msgid "This whole string should be extracted"
53 ${DIFF} xg-js-3.ok xg-js-3.pot