summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
authorMoritz Sichert <moritz.sichert@googlemail.com>2014-02-23 15:10:31 +0100
committerTim Graham <timograham@gmail.com>2015-03-20 17:27:41 -0400
commit6bb2175ed65456dda2f8ba584f206ba4bbd43dbc (patch)
tree0d9ba74e7dd7178b663d7883de50ace2e9485287 /docs/topics
parent556eb6770146f26a7f01f786034d8b3ec879ed05 (diff)
Fixed #22106 -- Allowed using more than one instance of javascript_catalog per project.
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/i18n/translation.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index 0f7e76756b..ea295ae8ca 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -952,6 +952,31 @@ different apps and this changes often and you don't want to pull in one big
catalog file. As a security measure, these values can only be either
``django.conf`` or any package from the :setting:`INSTALLED_APPS` setting.
+You can also split the catalogs in multiple URLs and load them as you need in
+your sites::
+
+ js_info_dict_app = {
+ 'packages': ('your.app.package',),
+ }
+
+ js_info_dict_other_app = {
+ 'packages': ('your.other.app.package',),
+ }
+
+ urlpatterns = [
+ url(r'^jsi18n/app/$', javascript_catalog, js_info_dict_app),
+ url(r'^jsi18n/other_app/$', javascript_catalog, js_info_dict_other_app),
+ ]
+
+If you use more than one ``javascript_catalog`` on a site and some of them
+define the same strings, the strings in the catalog that was loaded last take
+precedence.
+
+.. versionchanged:: 1.9
+
+ Before Django 1.9, the catalogs completely overwrote each other and you
+ could only use one at a time.
+
The JavaScript translations found in the paths listed in the
:setting:`LOCALE_PATHS` setting are also always included. To keep consistency
with the translations lookup order algorithm used for Python and templates, the