mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
[1.10.x] Fixed #25751 -- Doc'd how to use JavaScriptCatalog with i18n_patterns().
Backport of 9524fd9133e47fa90846904f81fe91c72f331e56 from master
This commit is contained in:
parent
0d8cdb5bc4
commit
cdc343cac3
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user