• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of JavaScript support.
5# Playing with concatenation of string literals within the gettext function
6
7cat <<\EOF > xg-js-3.js
8// The usual way to concatenate strings is the plus '+' sign
9var s1 = _("Concatenation #1 " + "- String part added");
10var s2 = _('Concatenation #2 ' + '- String part added');
11var s3 = _("This" + " whole "
12          + "string" +
13         ' should' + " be " + 'extracted');
14EOF
15
16: ${XGETTEXT=xgettext}
17${XGETTEXT} --add-comments=TRANSLATORS: --no-location -o xg-js-3.tmp xg-js-3.js 2>xg-js-3.err
18test $? = 0 || { cat xg-js-3.err; Exit 1; }
19func_filter_POT_Creation_Date xg-js-3.tmp xg-js-3.pot
20
21cat <<\EOF > xg-js-3.ok
22# SOME DESCRIPTIVE TITLE.
23# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
24# This file is distributed under the same license as the PACKAGE package.
25# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
26#
27#, fuzzy
28msgid ""
29msgstr ""
30"Project-Id-Version: PACKAGE VERSION\n"
31"Report-Msgid-Bugs-To: \n"
32"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
33"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
34"Language-Team: LANGUAGE <LL@li.org>\n"
35"Language: \n"
36"MIME-Version: 1.0\n"
37"Content-Type: text/plain; charset=CHARSET\n"
38"Content-Transfer-Encoding: 8bit\n"
39
40msgid "Concatenation #1 - String part added"
41msgstr ""
42
43msgid "Concatenation #2 - String part added"
44msgstr ""
45
46msgid "This whole string should be extracted"
47msgstr ""
48EOF
49
50: ${DIFF=diff}
51${DIFF} xg-js-3.ok xg-js-3.pot
52result=$?
53
54exit $result
55