diff options
| author | Moritz Sichert <moritz.sichert@googlemail.com> | 2014-02-23 15:10:31 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-03-20 17:27:41 -0400 |
| commit | 6bb2175ed65456dda2f8ba584f206ba4bbd43dbc (patch) | |
| tree | 0d9ba74e7dd7178b663d7883de50ace2e9485287 /docs | |
| parent | 556eb6770146f26a7f01f786034d8b3ec879ed05 (diff) | |
Fixed #22106 -- Allowed using more than one instance of javascript_catalog per project.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/releases/1.9.txt | 3 | ||||
| -rw-r--r-- | docs/topics/i18n/translation.txt | 25 |
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/releases/1.9.txt b/docs/releases/1.9.txt index bce55085ef..6ec8a3f455 100644 --- a/docs/releases/1.9.txt +++ b/docs/releases/1.9.txt @@ -143,6 +143,9 @@ Internationalization * The :func:`django.views.i18n.set_language` view now properly redirects to :ref:`translated URLs <url-internationalization>`, when available. +* The :func:`django.views.i18n.javascript_catalog` view now works correctly + if used multiple times with different configurations on the same page. + Management Commands ^^^^^^^^^^^^^^^^^^^ 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 |
