Kaydet (Commit) 9524fd91 authored tarafından Ben Wilkins's avatar Ben Wilkins Kaydeden (comit) Tim Graham

Fixed #25751 -- Doc'd how to use JavaScriptCatalog with i18n_patterns().

üst 412997f8
...@@ -1028,6 +1028,18 @@ The ``JavaScriptCatalog`` view ...@@ -1028,6 +1028,18 @@ The ``JavaScriptCatalog`` view
name='javascript-catalog'), 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 The precedence of translations is such that the packages appearing later in the
``packages`` argument have higher precedence than the ones appearing at 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 beginning. This is important in the case of clashing translations for the same
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment