[web2py] Re: T usage

2011-04-10 Thread Massimo Di Pierro
Yes but... If you do something like {{for record in db(...).select():}}{{=T(record.field}}{{pass}} you get a lot of data added dynamically to the translation files. It may slow down your app if the db data changes often. It may also result in lots of data not being translated. Two options are 1

Re: [web2py] Re: T usage

2011-04-09 Thread Stifan Kristi
Hi, is it possible to translate the output data table using T()? thank you so much On Sun, Apr 10, 2011 at 5:45 AM, niknok wrote: > Beautiful one liner. I have to write an ugly hack to make it work. I > was forcing the translations because I need to translate certain > sections only. > > def b

[web2py] Re: T usage

2011-04-09 Thread niknok
Beautiful one liner. I have to write an ugly hack to make it work. I was forcing the translations because I need to translate certain sections only. def babel(lang, s): # forced translation of Q&A section T.force(lang) if type(s)==list: loc_string=[] for i in s:

[web2py] Re: T usage

2011-04-07 Thread DenesL
Assuming options = a retrieved list:string record then choices = dict([(x,T(x)) for x in options]) should work. Note: untested. On Apr 7, 3:29 am, niknok wrote: > Thanks DenesL. > > What if the options are retrieved from a field of list:string type? > > On Apr 4, 10:39 pm, DenesL wrote: > >

[web2py] Re: T usage

2011-04-07 Thread niknok
Thanks DenesL. What if the options are retrieved from a field of list:string type? On Apr 4, 10:39 pm, DenesL wrote: > Use > > choices = {'Gold':T('Gold'), 'Silver':T('Silver')} > > and update your language translations strings. > Not sure how "answer" is obtained. > > On 4 abr, 09:16, niknok w

[web2py] Re: T usage

2011-04-04 Thread DenesL
Use choices = {'Gold':T('Gold'), 'Silver':T('Silver')} and update your language translations strings. Not sure how "answer" is obtained. On 4 abr, 09:16, niknok wrote: > I tried: > Field('color', 'list:string', default=answer, > requires=IS_IN_SET(T(question['choices']), zero=None, multiple=T