diff options
| author | Ben Wilkins <ben@prezola.com> | 2016-10-07 12:00:39 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-15 10:33:44 -0500 |
| commit | cdc343cac33d2e0b4d573e7c38ac0b2b7b19ea71 (patch) | |
| tree | 73613899731cbe734e7c22dae1698c2650d075cc | |
| parent | 0d8cdb5bc4513e959cf13fd96b21489e9045aa74 (diff) | |
[1.10.x] Fixed #25751 -- Doc'd how to use JavaScriptCatalog with i18n_patterns().
Backport of 9524fd9133e47fa90846904f81fe91c72f331e56 from master
| -rw-r--r-- | docs/topics/i18n/translation.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 1aa85e937d..cae4c264ea 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1045,6 +1045,18 @@ The ``JavaScriptCatalog`` view name='javascript-catalog'), ] + If your root URLconf uses :func:`~django.conf.urls.i18n.i18n_patterns`, + ``JavaScriptCatalog`` must also be wrapped by ``i18n_patterns()`` for the + catalog to be correctly generated. + + **Example with** ``i18n_patterns()``:: + + from django.conf.urls.i18n import i18n_patterns + + urlpatterns = i18n_patterns( + url(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'), + ) + The precedence of translations is such that the packages appearing later in the ``packages`` argument have higher precedence than the ones appearing at the beginning. This is important in the case of clashing translations for the same |
