diff options
| author | Yoong Kang Lim <yoongkang.lim@gmail.com> | 2016-01-27 21:32:06 +1100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-01-27 09:07:07 -0500 |
| commit | c2dfc3616af0b68f085fdf6ee41774c266fe54c5 (patch) | |
| tree | bd18aa68602283f695f43d2aacfa89b4b62387b0 | |
| parent | 79c3950562a3f9c9d6d5e37990dfa9eb84052de7 (diff) | |
[1.8.x] Fixed #26136 -- Removed URL reversing by dotted path from JavaScript catalog example.
Backport of 31817dd2eb69db54eb559716aae42fe55ada5fea from master
| -rw-r--r-- | AUTHORS | 1 | ||||
| -rw-r--r-- | docs/topics/i18n/translation.txt | 6 |
2 files changed, 4 insertions, 3 deletions
@@ -721,6 +721,7 @@ answer newbie questions, and generally made Django that much better: Yasushi Masuda <whosaysni@gmail.com> ye7cakf02@sneakemail.com ymasuda@ethercube.com + Yoong Kang Lim <yoongkang.lim@gmail.com> Zachary Voase <zacharyvoase@gmail.com> Zach Thompson <zthompson47@gmail.com> Zain Memon diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 70a312f7f2..db33e65fea 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -958,7 +958,7 @@ You hook it up like this:: } urlpatterns = [ - url(r'^jsi18n/$', javascript_catalog, js_info_dict), + url(r'^jsi18n/$', javascript_catalog, js_info_dict, name='javascript-catalog'), ] Each string in ``packages`` should be in Python dotted-package syntax (the @@ -978,7 +978,7 @@ changed by altering the ``domain`` argument. You can make the view dynamic by putting the packages into the URL pattern:: urlpatterns = [ - url(r'^jsi18n/(?P<packages>\S+?)/$', javascript_catalog), + url(r'^jsi18n/(?P<packages>\S+?)/$', javascript_catalog, name='javascript-catalog'), ] With this, you specify the packages as a list of package names delimited by '+' @@ -1003,7 +1003,7 @@ To use the catalog, just pull in the dynamically generated script like this: .. code-block:: html+django - <script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' %}"></script> + <script type="text/javascript" src="{% url 'javascript-catalog' %}"></script> This uses reverse URL lookup to find the URL of the JavaScript catalog view. When the catalog is loaded, your JavaScript code can use the following methods: |
