There is one logical problem with the parameteric router (as opposed to the 
regex routes) and that is how it handles missing 
applicaiton/controller/function. If one is missing, it assumes a default 
value specified by the routes.py configuration. In this process it must 
make some assumptions about what is missing.

For example /index is probably /{defaultapp}/{defaultcontroller}/index but 
what if there is a controller called index? or an app called index? what if 
"index" is instead and args[0]?
So as long there are no possible naming conflict everything is fine but if 
a naming conflict arises, it does not do what you expect.

This is unfixable without breaking people's app using the router. We may 
break backward compatibility and simplify it one of the next versions.

Massimo






On Monday, 11 July 2016 07:55:52 UTC-5, Carlos Cesar Caballero wrote:
>
> Thanks Anthony, I'll work in that, in my opinion the router is a very 
> important feature.
>
> Greetings.
>
> El 07/07/16 a las 11:59, Anthony escribió:
>
> For incoming URLs, you could map the language to a URL arg or query string 
> variable. For outgoing URLs, you could either set that same URL arg or var 
> and rely on a routes_out rewrite rule, or you could simply prepend URLs 
> generated via the URL() function with the language. In either case, you 
> could write a custom URL-generating function to automatically handle the 
> language.
>
> However, there is one limitation of the above -- the outgoing URLs won't 
> be written properly by any web2py components that automatically generate 
> URLs (e.g., the grid, auth.navbar, etc.) -- unless you monkey patch the 
> built-in URL() function or do some post-processing of the server-side DOM 
> objects generated by these components.
>
> An alternative would be to use a cookie to set the user's language, as the 
> admin app does.
>
> Anthony
>
> On Thursday, July 7, 2016 at 8:50:46 AM UTC-4, Carlos Cesar Caballero 
> wrote: 
>>
>> Hi, I need some starting point to implement the URL based 
>> internationalization using the pattern based router, I really need to use 
>> the router, but there is so little documentation...
>>
>> I am clonning our yii2 cms base application (supporting right now sites 
>> like http://santiagohermes.com <http://anniaalonso.com>
>> http://anniaalonso.com, <http://alborarquitectos.com>
>> http://alborarquitectos.com and <http://casamabehostal.com>
>> http://casamabehostal.com) and it is almost done (you can look working 
>> in http://daxslab.com/) but I need to add some functionalities with the 
>> router before sharing it to everyone.
>>
>> Greetings.
>>
> -- 
> 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.
>
>
>

-- 
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.

Reply via email to