[web2py] Re: Translate Controller names and Function names

2015-01-28 Thread Francisco Costa
On Wednesday, 28 January 2015 14:50:51 UTC, Jonathan Lundell wrote: > > There's also the alternative of embedding a language code in the URL and > not translating the URL elements. The parameter-based routing system > already supports that, and it would give you separate search-engine > indexi

[web2py] Re: Translate Controller names and Function names

2015-01-28 Thread Jonathan Lundell
There's also the alternative of embedding a language code in the URL and not translating the URL elements. The parameter-based routing system already supports that, and it would give you separate search-engine indexing. On Tuesday, January 27, 2015 at 4:12:42 AM UTC-8, Francisco Costa wrote: >

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Derek
Honestly, I have never seen a need for this. Any time I visit a foreign language site, the URL mapping is in english. Chinese, Japanese, Russian, all seem to keep the URL pretty much the same regardless of the language. I can usually hunt my way around a foreign language website by the links.For

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Leonel Câmara
This is a good question, maybe there should be more direct web2py support for it, as usability wise it's a nice feature. A wrapper is just a function that calls the other for you, like a decorator. In your case you could have something like this in your models. def TURL(**kwargs): if 'c' in

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Francisco Costa
Tx Jonathan, how would a wrapper for the URL() look like? -- 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 subscr

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Jonathan Lundell
I think that Niphlod is probably right, though I might be inclined to stick with your programmatic logic rather than use pattern-based routing. And maybe write a wrapper for URL() so that all the logic is in the same place and driven off the same tables. On Tuesday, January 27, 2015 at 4:12:42

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Francisco Costa
unfortunately it seams you can't use both rewrite systems, and I have other apps using the Parameter-based system On Tuesday, 27 January 2015 14:05:26 UTC, Niphlod wrote: > > IMHO you're better suited for routes > . As > long a

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Niphlod
IMHO you're better suited for routes . As long at the mapping is fixed, it's exactly what they've been engineered for. I'd use the pattern-based system On Tuesday, January 27, 2015 at 2:51:31 PM UTC+1, Francisco Costa wrote: >

[web2py] Re: Translate Controller names and Function names

2015-01-27 Thread Francisco Costa
I have this in models till now: views_translate = { # Controllers Names 'default' : 'principal', 'principal' : 'default', 'articles' : 'artigo', 'artigo': 'articles', # Function Names 'index' : 'inicio', 'inicio': 'index', 'new' : 'novo',