#25751: Translation of strings in a javascript file docs are incorrect
--------------------------------------+------------------------------------
     Reporter:  raratiru              |      Owner:  nobody
         Type:  Uncategorized         |     Status:  new
    Component:  Internationalization  |    Version:  1.8
     Severity:  Normal                |   Keywords:  javascript translation
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+------------------------------------
 To translate a string in a javascript file, the
 [https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#module-
 django.views.i18n docs] propose the following setup in the urls.py:


 {{{
 from django.views.i18n import javascript_catalog

 js_info_dict = {
     'packages': ('your.app.package',),
 }

 urlpatterns = [
     url(r'^jsi18n/$', javascript_catalog, js_info_dict),
 ]
 }}}

 This will not work unless the javascript url is added to urlpatterns under
 i18n_patterns:


 {{{
 from django.views.i18n import javascript_catalog
 from django.conf.urls.i18n import i18n_patterns

 js_info_dict = {
     'packages': ('your.app.package',),
 }

 urlpatterns = [
     ...
 ]

 urlpatterns += i18n_patterns(
     url(r'^jsi18n/$', javascript_catalog, js_info_dict),
 )
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25751>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.91ff8e4042a0ac79e7bb31e736c76c4a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to