Reputation: 2554
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?
Upvotes: 2
Views: 2322
Reputation: 1846
To use the jsi18n view you have 2 options:
This is described in the javascript_catalog documentation. Maybe you've missed it. I suggest taking another look:
Upvotes: 2