settings.py
INSTALLED_APPS = (
...
'myprojectname',
...
)
STATIC_ROOT = '/var/www/a_valid_path/'
LOCALE_PATHS = (
os.path.join(BASE_DIR, "locale"),
)
urls.py
js_info_dict = {
'domain': 'djangojs',
'packages': ('myprojectname',),
}
urlpatterns = patterns('',
...
url(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
...
)
My project structure is as follows:
|- projectname
|--- app1
|--- app2
|--- manage.py
|- virtualenv
|- static
|--- js
|--- css
I also have the locale
folder in the root folder of my project, where manage.py
is located.
Simply running:
./manage.py -l ro -d djangojs
It's not working. No .po
file is being generated. Server-side translation works, however (views + templates). I've followed all advice, and still nothing. Even tried to create the djangojs.po
file myself to see if Django deletes it, or does something with it -- nope.
No error is generated, just processing locale ro
is shown (for a really short time -- too short if you ask me), and that's that. Any help?
Edit: Forgot to mention that my folder containing the JS files is not inside each Django app, but in a separate location. Still, shouldn't Django look inside the STATICFILES_DIRS
?
Django's makemessages only will make messages from files that are in on one of your TEMPLATE_DIRS
. So any files you want to translate need to be in one of those directories.
You can do that in one several ways:
TEMPLATE_DIRS
as isIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With