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?
--You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/mAC48MURo50J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment