perhaps you can use request.cookies
e.g. taken from web2py admin app
*models/db.py*
if 'language' in request.cookies and not (request.cookies['language'] is
None):
T.force(request.cookies['language'].value)
else:
T.force('en')
*views/language.html*
{{extend 'layout.html'}}
{{if hasattr(T,'get_possible_languages_info'):}}
<select name="language" onchange="var date = new
Date();cookieDate=date.setTime(date.getTime()+(100*24*60*60*1000));document.cookie='language='+this.options[this.selectedIndex].id+';
expires='+cookieDate+'; path=/';window.location.reload()">
{{for langinfo in sorted([(code,info[1]) for code,info in
T.get_possible_languages_info().iteritems() if code != 'default']):}}
<option {{=T.accepted_language==langinfo[0] and 'selected' or ''}}
{{='id='+langinfo[0]}} >{{=langinfo[1]}}</option>
{{pass}}
</select>
{{else:}}
{{pass}}
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.