I keep ending up with an empty catalog in my jsi18n JavaScript. I have tried all the solutions on StackOverflow including Empty catalog when internationalizing JavaScript code, but the catalog is still empty.
My setup is this:
project_dir
- locale
- nl (contains LC_MESSAGES with django.po and djangojs.po)
- app1
- app2
- main_app
- settings.py
- urls.py
- wsgi.py
In settings.py I have
# Where to find locale
LOCALE_PATHS = (
os.path.join(SITE_ROOT, 'locale'),
)
SITE_ROOT is the absolute path to my project dir, so this translates to
In urls.py I have
# i18n
js_info_dict = {
'domain': 'djangojs',
'packages': ('wrnpro', ),
}
and
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
as part of my urls.
If I run the app and call http://localhost:8000/jsi18n/
I get
/* gettext library */
var catalog = new Array();
function pluralidx(count) { return (count == 1) ? 0 : 1; }
…
So far I have tried every variation of settings etc. I could find, but the catalog remains empty.
When running make messages
and compile messages
my JavaScript get text strings are found and translated. The django.po and .mo files are in the locale directory.
Anyone?