JavaScript translation problem

22 views
Skip to first unread message

galgal

unread,
Sep 4, 2011, 3:15:12 PM9/4/11
to django...@googlegroups.com

Hi I have a problem with JS translation in Django. I did everything like is said in documentation, so: I made .po then .mo files (django.mo, djangojs.mo). Translated files are in path: *myapp/locale/pl/LC_MESSAGES/* and *myapp/locale/en/LC_MESSAGES/* Translations in .html and .py files work OK. The only problem is that JS translation always displays original phrase, not translated. main urls.py:

urlpatterns += patterns('', (r'^jsi18n/$', 'django.views.i18n.javascript_catalog',{}), )

template file in header (as first JS part):

<script type="text/javascript" src="{% url django.views.i18n.javascript_catalog %}"></script>

All my js files are in path /myapp/site_media/js/ and the only .mo files are in path which I wrote before. I use gettext() in JS strings.

What did I do wrong?

Reply all
Reply to author
Forward
0 new messages