Different from Django multilingual implementation by using cookie, I want to add lang code to every url, i.e:
/en/my_app/something_here/1/2/3/4/
/de/my_app/something_here/1/2/3/4/
/fr/my_app/something_here/1/2/3/4/
The main reason I do this if for Google to index more pages from my site. I don't want Google to index just the English version (default language), but I think that what will happen if I use cookies.
I hope this approcae can be integrated with pre-existing Django apps without much hassles. I currently in fond of flatpages :)
Do anyone have any idea on how to do this? TIA.
--Tirta
My suggestion would be to look at e.g. Apache's URL rewriting rules.
Take those URLs and produce
/my_app/something_here/1/2/3/4/?lang={en,de,fr}, then pick that up in
your environment. Maybe make some middleware that picks that out of the
GET parameters automatically and gives you it in some useful way. I'm
guessing what you want to use it for is to select which directory you
pick your templates from.
Just a thought,
--
Paul Wayper
SYSTEMS ENGINEER
TransACT
Telephone: 02 6229 8026
Mobile: 0422 392 081
PO Box 1006, Civic Square ACT 2608
Joost Cassee's localeurl project
(http://code.google.com/p/django-localeurl/ ) is one approach to this
problem that seems fairly well thought out.
Regards,
Malcolm