Niphlod, I understand that web2py expects something like /a/lang/c/f or /lang/c/f, but playing with request.something I didn't manage to obtain that. :) Any tips? Thanks for your help.
Have a good night. David On 16 November 2012 15:25, Niphlod <[email protected]> wrote: > URL('it') is "go to the "it" function in the same controller I'm in". > haven't played with that, but I guess web2py expects something like > /a/lang/c/f so, by some means of request.something > (function,controller,args,etc) you should be able to..... > > > > On Friday, November 16, 2012 12:23:52 PM UTC+1, David Sorrentino wrote: > >> Very last doubt, I promise! :P >> >> Let us assume that I am visiting the page at this url: >> >> /en/portfolio >>> >> >> and I want to change to /it/portfolio, how can I set URL in order to do >> that? >> If I set it like this: >> >> URL('it') >>> >> >> I will obtain: >> >> /en/it >>> >> >> which is an invalid function. >> >> Cheers, >> David >> >> >> On 16 November 2012 11:33, David Sorrentino <[email protected]> wrote: >> >>> Hi Niphlod, >>> >>> Thanks for your example. It's crystal clear. ;) >>> I got another doubt about multi-languages: on the online book I read >>> that in order to tell web2py which language is the default one, I have to >>> use: >>> >>> T.set_current_languages('it') >>>> >>> >>> Now I am wondering if I need to use it in the controller and call it >>> every time I load a page, or I can put it somewhere else and tell web2py >>> just once which one is the default language. >>> >>> Sorry for all these doubts! :P >>> >>> Cheers, >>> David >>> >>> >>> >>> On 15 November 2012 21:46, Niphlod <[email protected]> wrote: >>> >>>> I'd do the following >>>> 1. choose a storage option for your content (you may want to use a >>>> simple table with a 'text' field for editing online, or code something to >>>> save the content to a "txt" file) >>>> 2. code something that inspects the uri_language and does >>>> (semi-programming-language): >>>> if exists "nameoftherequestedarticle": >>>> if uri_language in "translationsofthearticle": >>>> content = translatedarticle >>>> else: >>>> content = originalarticle (english ?) >>>> else: >>>> raise 404 >>>> >>>> -- >>>> >>>> >>>> >>>> >>> >>> >> -- > > > > --

