Path problem with jsi18n - internationalization

855 views
Skip to first unread message

Tipan

unread,
Jan 11, 2009, 11:48:06 AM1/11/09
to Django users
I'm having a problem accessing Javascript Translation catalog whilst
converting my site to multi-language. As suggested in the docs, I have
added the following to my applications top level urls file.


js_info_dict = {
'packages': ( 'myapp.myproject',),
}

(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),

However, when I render my template the url to jsi18n generates a "url
not found" error in Firebug. The docs say /path/to/jsi18n, but I'm not
sure how to reconcile this properly with my app.

<script type="text/javascript" src="/jsi18n/"></script>

Can anyone give me a pointer - I'm sure I'm missing the obvious, but
can't see it at the moment.

Thanks, T

Ramiro Morales

unread,
Jan 11, 2009, 12:08:50 PM1/11/09
to django...@googlegroups.com

What version of Django are you using?, which web server? what deployment
method? Does the web server show a 404 error in its logs when the /jsi18n/
URL is accessed from the browser? What happens if you manually open with
your browser the http://<server>/jsi18n/ URL?.

Regards,

--
Ramiro Morales

Tipan

unread,
Jan 11, 2009, 3:43:19 PM1/11/09
to Django users
Hi Ramiro,

I'm using the latest development version of Django. Apache web server.
MySqL/Mod_python, all served from same apache on my laptop.

I get a 404 error when I put http://<server>/jsi18n/ into the browser
URL.

Rgds, Tim

Ramiro Morales

unread,
Jan 11, 2009, 4:43:04 PM1/11/09
to django...@googlegroups.com

That's strange, are you succesfully using another component of Django
i18n infrastructure in the same application?. De you have USE_I18N set to
True in the settings file you are using?

--
Ramiro Morales

Tipan

unread,
Jan 13, 2009, 4:02:47 AM1/13/09
to Django users
>
> That's strange, are you succesfully using another component of Django
> i18n infrastructure in the same application?. De you have USE_I18N set to
> True in the settings file you are using?
>

Yes. The use_i18n is set to true and I've successfully translated most
of my pages, created the .po files with makemessages etc. It's just
the Javascript library element I can't seem to get working.

I just assumed I'd got the wrong path in the template to access the
jsi18n javascript.

Tim
Reply all
Reply to author
Forward
Message has been deleted
0 new messages