1
0
mirror of https://github.com/django/django.git synced 2025-07-18 16:49:13 +00:00

[1.0.X] Fixed #11364 -- Modified the jsi18n example to use the {% url %} tag rather than a placeholder. Thanks to jcassee for the suggestion.

Merge of r11237 from trunk.


git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@11244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2009-07-15 14:21:19 +00:00
parent 500202337e
commit c7289a0402

View File

@ -959,11 +959,11 @@ Using the JavaScript translation catalog
To use the catalog, just pull in the dynamically generated script like this:: To use the catalog, just pull in the dynamically generated script like this::
<script type="text/javascript" src="/path/to/jsi18n/"></script> <script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>
This is how the admin fetches the translation catalog from the server. When the This uses reverse URL lookup to find the URL of the JavaScript catalog view.
catalog is loaded, your JavaScript code can use the standard ``gettext`` When the catalog is loaded, your JavaScript code can use the standard
interface to access it:: ``gettext`` interface to access it::
document.write(gettext('this is to be translated')); document.write(gettext('this is to be translated'));