2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test of JavaScript E4X support.
6 cat <<\EOF > xg-js-6.js
8 var s1 = _("Expected translation string #1");
10 var x2 = <{s2}>foo {s2} bar</{s2}>;
11 var x3 = <x3 a1="/"><x4>{_("Expected translation string #2")}</x4></x3>;
12 var x4 = <x5 a2='/'><x{_("Expected translation string #3")}>
13 </x{_("Expected translation string #3")}></x5>;
15 _("Unexpected translation string #1")
17 var x5 = <!-- - _("Unexpected translation string #2") - -->;
18 var s6 = _("Expected translation string #4");
19 var x6 = <? _("Unexpected translation string #3") ?>;
20 var x7 = <!--- this is a comment --> <foo>
21 var s7 = "<{x6}>_("Unexpected translation string #4")</{x6}>" +
22 "<!-- _("Unexpected translation string #5") --!>" +
23 _("Expected translation string #5");
24 var s8 = _("<x7>Expected translation string #6</x7>");
25 var x8 = <x8><x9>{_("<x8>{Expected translation string #7}</x8>")}</x9></x8>
26 var x9 = <x10 attr='{_("Unexpected translation string #6")}'><x11>data</x11></x10>;
27 var s9 = _("Expected translation string #8");
31 : ${XGETTEXT=xgettext}
32 ${XGETTEXT} --add-comments --no-location -o xg-js-6.tmp xg-js-6.js 2>xg-js-6.err
33 test $? = 0 || { cat xg-js-6.err; exit 1; }
34 # Don't simplify this to "grep ... < xg-js-6.tmp", otherwise OpenBSD 4.0 grep
35 # only outputs "Binary file (standard input) matches".
36 cat xg-js-6.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-js-6.pot
38 cat <<\EOF > xg-js-6.ok
39 # SOME DESCRIPTIVE TITLE.
40 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
41 # This file is distributed under the same license as the PACKAGE package.
42 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
47 "Project-Id-Version: PACKAGE VERSION\n"
48 "Report-Msgid-Bugs-To: \n"
49 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
50 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
51 "Language-Team: LANGUAGE <LL@li.org>\n"
54 "Content-Type: text/plain; charset=CHARSET\n"
55 "Content-Transfer-Encoding: 8bit\n"
57 msgid "Expected translation string #1"
60 msgid "Expected translation string #2"
63 msgid "Expected translation string #3"
66 msgid "Expected translation string #4"
69 msgid "Expected translation string #5"
72 msgid "<x7>Expected translation string #6</x7>"
75 msgid "<x8>{Expected translation string #7}</x8>"
78 msgid "Expected translation string #8"
83 ${DIFF} xg-js-6.ok xg-js-6.pot