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 current function.
If fact if I switch with (in my menu):
{{response.menu.append(('IT', False, URL('it', 'index'), [('EN', False, 
URL('en', 'index'), [])]))}}

It works fine.
If I try with request.function, request.function give me the language + the 
function:
{{response.menu.append(('IT', False, URL('it', request.function), [('EN', 
False, URL('en', request.function), [])]))}}
So if I have mydomain.com/it and I ask for english, web2py tries to load 
mydomain.com/it/en . KO.

Is there an elegant way to avoid this problem of do I have to play with a 
session variable ?

Regards.




Il giorno domenica 12 gennaio 2014 17:35:22 UTC+1, Jonathan Lundell ha 
scritto:
>
> On 12 Jan 2014, at 8:27 AM, Alan Etkin <spam...@gmail.com <javascript:>> 
> 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 dictionary key.
>
> routers = {
>     "test": dict(
>
>         default_language = possible_languages['default'][0],
> ...
>
>
> Alan is right; I was misreading the containing dict.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to