summaryrefslogtreecommitdiff
path: root/tests/regressiontests/i18n/commands/javascript.js
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-06-07 16:11:25 +0000
committerJannis Leidel <jannis@leidel.info>2011-06-07 16:11:25 +0000
commit64e19ffb4ee32767861d25c874f0d2dfc75618b7 (patch)
tree11d0e86691bcb8917822d3d2a8abee6972642585 /tests/regressiontests/i18n/commands/javascript.js
parentd14eb13992e782b2dfa7f2633b38a87e34efd45e (diff)
Fixed #7704, #14045 and #15495 -- Introduce a lexer for Javascript to fix multiple problems of the translation of Javascript files with xgettext. Many thanks to Ned Batchelder for his contribution of the JsLex library.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16333 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/i18n/commands/javascript.js')
-rw-r--r--tests/regressiontests/i18n/commands/javascript.js47
1 files changed, 45 insertions, 2 deletions
diff --git a/tests/regressiontests/i18n/commands/javascript.js b/tests/regressiontests/i18n/commands/javascript.js
index bc5ec87957..fa059d70f4 100644
--- a/tests/regressiontests/i18n/commands/javascript.js
+++ b/tests/regressiontests/i18n/commands/javascript.js
@@ -1,4 +1,47 @@
// '
gettext('This literal should be included.')
-// '
-gettext('This one as well.')
+x = y; // '
+gettext("This one as well.")
+
+/** (from ticket 7704)
+ * *****************************
+ * AddModule main / window
+ * @constructor
+ * @class MyDesktop.AddModule
+ * *****************************
+ */
+
+gettext('He said, \"hello".')
+
+// from ticket 14045
+function mfunc() {
+ var val = 0;
+ return val ? 1 : 0;
+}
+gettext('okkkk');
+print mysub();
+
+// from ticket 15495
+/* / ' */ gettext("TEXT");
+
+gettext("It's at http://example.com")
+
+// also from ticket 15495
+gettext("String"); // This comment won't be caught by pythonize_re and it contains "'" which is a string start in Perl
+/*
+ * This one will be removed by the patch
+ */
+gettext("/* but this one will be too */ 'cause there is no way of telling...");
+f(/* ... if it's different from this one */);
+
+// from ticket 15331
+gettext("foo");
+true ? true : false;
+gettext("bar");
+true ? true : false;
+gettext("baz");
+true ? true : false; // ?
+gettext("quz");
+"?";
+gettext("foobar");
+