Re: Locale from URL Middleware

2006-05-19 Thread jon1012
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

Advanced Locale from URL middleware

2006-06-22 Thread jon1012
A middleware that permits to change the locale based on the url was posted here one month ago by Atlithorn. For example, when you go to /fr/article/*** you get the article in french, and when you go to /en/article/*** you get the article in english... I've gone a little further making a version

Re: Advanced Locale from URL middleware

2006-06-22 Thread jon1012
the last code has a bug, here is the new one, and sorry :) class LocaleURLMiddleware: def get_language_from_request (self,request): from django.conf import settings import re supported = dict(settings.LANGUAGES) lang = settin

Re: Advanced Locale from URL middleware

2006-06-26 Thread jon1012
Hi Adrian, Ok, no problem, I'll just post a message on my blog and link to it from the wiki page. Jon --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: Advanced Locale from URL middleware

2006-07-02 Thread jon1012
Hi Adrian, Here is my blog post about it (in french and english): http://www.jondesign.net/articles/2006/jul/02/langue-depuis-url-django-url-locale-middleware/ I'll put it on the wiki. Jon --~--~-~--~~~---~--~~ You received this message because you are subscri