[web2py] Re: request.uri_language

2015-02-26 Thread Bas van Wetten
I realize this is an old thread but I was experiencing similar problems with web2py and it's custom language behavior. The problem is with the next assignment. The parameter passed to the 'read_possible_languages' function is not the correct path for the language files. possible_languages = re

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Jonathan Lundell
On 13 Jan 2014, at 7:48 AM, Gael Princivalle wrote: > That's a good solution, thanks. > > In the meantime I've found that you have to specify with C=...the controller > and f=... the functiuon in the URL helper. > > That like that it works fine: > {{response.menu.append(('IT', False, URL('it',

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Gael Princivalle
That's a good solution, thanks. In the meantime I've found that you have to specify with C=...the controller and f=... the functiuon in the URL helper. That like that it works fine: {{response.menu.append(('IT', False, URL('it', f=request.function), [('EN', False, URL('en', f=request.function),

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Jonathan Lundell
On 13 Jan 2014, at 7:00 AM, Gael Princivalle wrote: > Thanks Alan, Jonathan. > > I've test more this simple solution: > routers = dict( > BASE = dict(default_application=' > test'), > test = dict(languages=['en', 'it'], default_language='it'), > ) > > And it works fine for me. > > The

Re: [web2py] Re: request.uri_language

2014-01-13 Thread Gael Princivalle
Thanks Alan, Jonathan. I've test more this simple solution: routers = dict( BASE = dict(default_application=' test'), test = dict(languages=['en', 'it'], default_language='it'), ) And it works fine for me. The only problem I have now if for switching between two languages reloading the

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 8:27 AM, Alan Etkin wrote: > I've got this server error: > 200 Error > > > My bad, unless you have specified the name or it is available in that scope, > using app, test or whatever would raise a NameError. Perhaps it can be solved > using a string ("test") for the dictionar

[web2py] Re: request.uri_language

2014-01-12 Thread Alan Etkin
> > I've got this server error: > 200 Error > My bad, unless you have specified the name or it is available in that scope, using app, test or whatever would raise a NameError. Perhaps it can be solved using a string ("test") for the dictionary key. routers = { "test": dict( defau

Re: [web2py] Re: request.uri_language

2014-01-12 Thread Jonathan Lundell
On 12 Jan 2014, at 7:51 AM, Gael Princivalle wrote: > And this routes.py in test folder: > from fileutils import abspath > from languages import read_possible_languages > possible_languages = read_possible_languages(abspath('applications', test)) > routers = { > test: dict( > default_l

[web2py] Re: request.uri_language

2014-01-12 Thread Gael Princivalle
Thanks Alan you're right. But with this routes.py in web2py root : routers = dict( BASE=dict( default_application='test', ), ) And this routes.py in test folder: from fileutils import abspath from languages import read_possible_languages possible_languages = read_possible_languages

[web2py] Re: request.uri_language

2014-01-12 Thread Alan Etkin
> > Is it possible that nobody knows how this request.uri.language works ? > Shouldn't this app: dict( be this way instead? test: dict( -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.c

[web2py] Re: request.uri_language

2014-01-12 Thread Gael Princivalle
Is it possible that nobody knows how this request.uri.language works ? Il giorno venerdì 10 gennaio 2014 13:32:19 UTC+1, Gael Princivalle ha scritto: > > Hello all. > > I'm in trouble with language management. > Here is my routes.py at web2py root (standard): > routers = dict( > > # base rout