On 3 Sty, 08:48, Fran <[email protected]> wrote: > > I do not like the way web2py distinguish 'en' and 'en-en' as two > > different languages, so I wrote a simple code which fix it. > > lang = request.env.http_accept_language.split(',')[0].split(';') > > [0].split('-')[0] > > if lang not in [all_available_languages]: lang = DEFAULT_LANG > > T.force(lang) > > Nice - I may use this :) > Probably as a customisable policy since it can get 'political' ;)
I polished the code and put it into models/db.py file http://pastie.org/351923 -- JZ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" 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/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

