I've done an helper function that strips the selected language from the
current url and return it... Usefull to make a language change button..
All you have to do is to make a link to the url with '/fr' for example
in front of the value given by the function:
from django.conf import settings
def get_absolute_path_without_lang(request):
for lang in settings.LANGUAGES:
if '/' + str(lang[0]) + '/' in request.path:
return request.path.replace('/' + str(lang[0]) + '/',
'/')
return request.path
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---