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



--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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/d/optout.

Reply via email to