diff -r 84ec6befeb13 tests/regressiontests/admin_views/tests.py
--- a/tests/regressiontests/admin_views/tests.py	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/admin_views/tests.py	Wed May 12 15:14:10 2010 -0300
@@ -2,7 +2,6 @@
 
 import re
 import datetime
-from django.conf import settings
 from django.core.files import temp as tempfile
 from django.test import TestCase
 from django.contrib.auth import admin # Register auth models with the admin.
@@ -16,12 +15,11 @@
 from django.utils import formats
 from django.utils.cache import get_max_age
 from django.utils.html import escape
-from django.utils.translation import get_date_formats, activate, deactivate
 from django.utils.encoding import iri_to_uri
 
 # local test models
 from models import Article, BarAccount, CustomArticle, EmptyModel, \
-    ExternalSubscriber, FooAccount, Gallery, ModelWithStringPrimaryKey, \
+    FooAccount, Gallery, ModelWithStringPrimaryKey, \
     Person, Persona, Picture, Podcast, Section, Subscriber, Vodcast, \
     Language, Collector, Widget, Grommet, DooHickey, FancyDoodad, Whatsit, \
     Category, Post, Plot, FunkyTag
@@ -272,33 +270,6 @@
         response = self.client.get("/test_admin/admin/admin_views/post/")
         self.failUnless('icon-unknown.gif' in response.content)
 
-    def testI18NLanguageNonEnglishDefault(self):
-        """
-        Check if the Javascript i18n view returns an empty language catalog
-        if the default language is non-English but the selected language
-        is English. See #13388 and #3594 for more details.
-        """
-        old_language_code = settings.LANGUAGE_CODE
-        settings.LANGUAGE_CODE = 'fr'
-        activate('en-us')
-        response = self.client.get('/test_admin/admin/jsi18n/')
-        self.assertNotContains(response, 'Choisir une heure')
-        deactivate()
-        settings.LANGUAGE_CODE = old_language_code
-
-    def testI18NLanguageNonEnglishFallback(self):
-        """
-        Makes sure that the fallback language is still working properly
-        in cases where the selected language cannot be found.
-        """
-        old_language_code = settings.LANGUAGE_CODE
-        settings.LANGUAGE_CODE = 'fr'
-        activate('none')
-        response = self.client.get('/test_admin/admin/jsi18n/')
-        self.assertContains(response, 'Choisir une heure')
-        deactivate()
-        settings.LANGUAGE_CODE = old_language_code
-
 
 class SaveAsTests(TestCase):
     fixtures = ['admin-views-users.xml','admin-views-person.xml']
diff -r 84ec6befeb13 tests/regressiontests/views/app1/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/regressiontests/views/app1/__init__.py	Wed May 12 15:14:10 2010 -0300
@@ -0,0 +1,1 @@
+#
diff -r 84ec6befeb13 tests/regressiontests/views/app1/locale/fr/LC_MESSAGES/djangojs.mo
Binary file tests/regressiontests/views/app1/locale/fr/LC_MESSAGES/djangojs.mo has changed
diff -r 84ec6befeb13 tests/regressiontests/views/app1/locale/fr/LC_MESSAGES/djangojs.po
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/regressiontests/views/app1/locale/fr/LC_MESSAGES/djangojs.po	Wed May 12 15:14:10 2010 -0300
@@ -0,0 +1,20 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-15 19:15+0200\n"
+"PO-Revision-Date: 2010-05-12 12:41-0300\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "this app1 string is to be translated"
+msgstr "il faut traduire cette chaîne de caractères de app1"
diff -r 84ec6befeb13 tests/regressiontests/views/app2/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/regressiontests/views/app2/__init__.py	Wed May 12 15:14:10 2010 -0300
@@ -0,0 +1,1 @@
+#
diff -r 84ec6befeb13 tests/regressiontests/views/app2/locale/fr/LC_MESSAGES/djangojs.mo
Binary file tests/regressiontests/views/app2/locale/fr/LC_MESSAGES/djangojs.mo has changed
diff -r 84ec6befeb13 tests/regressiontests/views/app2/locale/fr/LC_MESSAGES/djangojs.po
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/regressiontests/views/app2/locale/fr/LC_MESSAGES/djangojs.po	Wed May 12 15:14:10 2010 -0300
@@ -0,0 +1,20 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-09-15 19:15+0200\n"
+"PO-Revision-Date: 2010-05-12 12:41-0300\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "this app2 string is to be translated"
+msgstr "il faut traduire cette chaîne de caractères de app1"
diff -r 84ec6befeb13 tests/regressiontests/views/locale/es/LC_MESSAGES/djangojs.mo
Binary file tests/regressiontests/views/locale/es/LC_MESSAGES/djangojs.mo has changed
diff -r 84ec6befeb13 tests/regressiontests/views/locale/es/LC_MESSAGES/djangojs.po
--- a/tests/regressiontests/views/locale/es/LC_MESSAGES/djangojs.po	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/views/locale/es/LC_MESSAGES/djangojs.po	Wed May 12 15:14:10 2010 -0300
@@ -9,7 +9,7 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2007-09-15 16:45+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2010-05-12 12:57-0300\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -18,4 +18,8 @@
 
 #: media/js/translate.js:1
 msgid "this is to be translated"
-msgstr "esto tiene que ser traducido"
\ No newline at end of file
+msgstr "esto tiene que ser traducido"
+
+
+msgid "Choose a time"
+msgstr "Elige una hora"
diff -r 84ec6befeb13 tests/regressiontests/views/locale/fr/LC_MESSAGES/djangojs.mo
Binary file tests/regressiontests/views/locale/fr/LC_MESSAGES/djangojs.mo has changed
diff -r 84ec6befeb13 tests/regressiontests/views/locale/fr/LC_MESSAGES/djangojs.po
--- a/tests/regressiontests/views/locale/fr/LC_MESSAGES/djangojs.po	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/views/locale/fr/LC_MESSAGES/djangojs.po	Wed May 12 15:14:10 2010 -0300
@@ -9,7 +9,7 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2007-09-15 19:15+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2010-05-12 12:41-0300\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -17,4 +17,8 @@
 "Content-Transfer-Encoding: 8bit\n"
 
 msgid "this is to be translated"
-msgstr "il faut le traduire"
\ No newline at end of file
+msgstr "il faut le traduire"
+
+
+msgid "Choose a time"
+msgstr "Choisir une heure"
diff -r 84ec6befeb13 tests/regressiontests/views/locale/ru/LC_MESSAGES/djangojs.mo
Binary file tests/regressiontests/views/locale/ru/LC_MESSAGES/djangojs.mo has changed
diff -r 84ec6befeb13 tests/regressiontests/views/locale/ru/LC_MESSAGES/djangojs.po
--- a/tests/regressiontests/views/locale/ru/LC_MESSAGES/djangojs.po	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/views/locale/ru/LC_MESSAGES/djangojs.po	Wed May 12 15:14:10 2010 -0300
@@ -9,7 +9,7 @@
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2007-09-15 16:45+0200\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2010-05-12 12:57-0300\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
 "MIME-Version: 1.0\n"
@@ -17,4 +17,8 @@
 "Content-Transfer-Encoding: 8bit\n"
 
 msgid "this is to be translated"
-msgstr "перевод"
\ No newline at end of file
+msgstr "перевод"
+
+
+msgid "Choose a time"
+msgstr "Выберите время"
diff -r 84ec6befeb13 tests/regressiontests/views/tests/i18n.py
--- a/tests/regressiontests/views/tests/i18n.py	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/views/tests/i18n.py	Wed May 12 15:14:10 2010 -0300
@@ -1,8 +1,9 @@
+# -*- coding:utf-8 -*-
 import gettext
 
 from django.conf import settings
 from django.test import TestCase
-from django.utils.translation import activate
+from django.utils.translation import activate, deactivate
 from django.utils.text import javascript_quote
 
 from regressiontests.views.urls import locale_dir
@@ -30,6 +31,7 @@
             # javascript_quote is used to be able to check unicode strings
             self.assertContains(response, javascript_quote(trans_txt), 1)
 
+
 class JsI18NTests(TestCase):
     """
     Tests django views in django/views/i18n.py that need to change
@@ -66,3 +68,57 @@
         activate('fi')
         response = self.client.get('/views/jsi18n/')
         self.assertContains(response, 'il faut le traduire')
+
+    def testI18NLanguageNonEnglishDefault(self):
+        """
+        Check if the Javascript i18n view returns an empty language catalog
+        if the default language is non-English but the selected language
+        is English. See #13388 and #3594 for more details.
+        """
+        settings.LANGUAGE_CODE = 'fr'
+        activate('en-us')
+        response = self.client.get('/views/jsi18n/')
+        self.assertNotContains(response, 'Choisir une heure')
+        deactivate()
+
+    def testI18NLanguageNonEnglishFallback(self):
+        """
+        Makes sure that the fallback language is still working properly
+        in cases where the selected language cannot be found.
+        """
+        settings.LANGUAGE_CODE = 'fr'
+        activate('none')
+        response = self.client.get('/views/jsi18n/')
+        self.assertContains(response, 'Choisir une heure')
+        deactivate()
+
+
+class JsI18NTestsMultiPackage(TestCase):
+    """
+    Tests for django views in django/views/i18n.py that need to change
+    settings.LANGUAGE_CODE and merge JS translation from several packages.
+    """
+    VIEW_PATH = '/views/jsi18n_multiple_packages/'
+
+    def setUp(self):
+        self.old_language_code = settings.LANGUAGE_CODE
+        self.old_installed_apps = settings.INSTALLED_APPS
+        settings.INSTALLED_APPS = list(settings.INSTALLED_APPS) + ['regressiontests.views.app1', 'regressiontests.views.app2']
+
+    def tearDown(self):
+        settings.LANGUAGE_CODE = self.old_language_code
+        settings.INSTALLED_APPS = self.old_installed_apps
+
+    def testI18NLanguageNonEnglishDefault(self):
+        """
+        Check if the Javascript i18n view returns a complete language catalog
+        if the default language is en-us, the selected language is available
+        and a catalog composed by djangojs domain translations of multiple
+        Python packages is requested. See #13388, #3594 and #13514 for more details.
+        """
+        settings.LANGUAGE_CODE = 'en-us'
+        activate('fr')
+        response = self.client.get(self.VIEW_PATH)
+        #print response.content
+        self.assertContains(response, 'il faut traduire cette chaîne de caractères de app1')
+        deactivate()
diff -r 84ec6befeb13 tests/regressiontests/views/urls.py
--- a/tests/regressiontests/views/urls.py	Wed May 12 10:34:05 2010 -0300
+++ b/tests/regressiontests/views/urls.py	Wed May 12 15:14:10 2010 -0300
@@ -16,6 +16,11 @@
     'packages': ('regressiontests.views',),
 }
 
+js_info_dict_multiple_packages = {
+    'domain': 'djangojs',
+    'packages': ('regressiontests.views', 'regressiontests.views.app1', 'regressiontests.views.app2'),
+}
+
 date_based_info_dict = {
     'queryset': Article.objects.all(),
     'date_field': 'date_created',
@@ -36,6 +41,7 @@
     # i18n views
     (r'^i18n/', include('django.conf.urls.i18n')),
     (r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
+    (r'^jsi18n_multiple_packages/$', 'django.views.i18n.javascript_catalog', js_info_dict_multiple_packages),
 
     # Static views
     (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': media_dir}),
