Well, I had it in mind, but it won't work very well. First of all, I can't consider this a part of the API, and it can change over time. One of the reason I like web2py is the API stability. The other problem I have, is in the case the language does not exist. Say I created a site with Italian as default language (defined on current_languages), and translated to French, will give an error if I'm using a normal browser, set to work with English only. I can bypass this problem with try and except. But it will make an ugly code.
On May 10, 7:00 pm, Álvaro Justen [Turicas] <alvarojus...@gmail.com> wrote: > On Sun, May 10, 2009 at 6:08 AM, guruyaya <guruy...@gmail.com> wrote: > > I'd like to know if there's a function that returns the current > > language in use. I cannot read this from the headers, as it could be > > that the user language is being forced. The process of analyzing the > > language from the accepted language is problematic, as it can change > > in the course of time. > > Well, is there a way? > > Try T.accepted_language > > -- > Álvaro Justen > Peta5 - Telecomunicações e Software Livre > 21 3021-6001 / 9898-0141 > http://www.peta5.com.br/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---