After successfully translating a javascript file named djangojs.po
within my django project, I executed the following command:
./manage.py compilemessages -l fr #this correctly generates my djangojs.mo file
Next, I made edits to my urls.py file:
js_info_dict = {
'domain': 'djangojs',
'packages': ('my_app',),
}
#added to urlpatterns = patterns('',
...
url(r'^jsi18n/', 'django.views.i18n.javascript_catalog', js_info_dict),
Upon visiting http://localhost:8000/jsi18n/
in my browser, I received a javascript file, but the django.catalogue appeared empty.
django.catalog = django.catalog || {};
This left me wondering, where did my translated strings disappear to?
For your information, translation functions properly on my template code with the presence of a django.mo
file located in the same directory as djangojs.mo
. The Django version being used is 1.9.6.