25.07.12 16:52, ctrlSoft написав(ла):
browser is set up to english, but in model i do T.force('ro'). without forced translation result is the same --




please do these steps and post the result here:

1. add test() function into applicatons/welcome/controllers/default.py:

def test():
import datetime
d=datetime.datetime.strptime('2012-07-18 10:00:00', '%Y-%m-%d %H:%M:%S')
T.force('ro')
return locals()

2. copy test.html (see attachment) into 
applications/welcome/views/default/test.html

3. open page http://127.0.0.1:8000/welcome/default/test and post the output here

Vladyslav Kozlovskyy

--



{{extend 'layout.html'}}

Prettydate test

now:{{=prettydate(datetime.datetime.now(),T)}}
{{=prettydate(d,T)}}
{{for year in xrange(2000,2013):}} {{dd=datetime.datetime.strptime('%s-07-01 10:00:00'%year, '%Y-%m-%d %H:%M:%S')}}
{{=prettydate(dd,T)}} {{pass}}
{{for month in xrange(1,8):}} {{dd=datetime.datetime.strptime('2012-%s-01 10:00:00'%month, '%Y-%m-%d %H:%M:%S')}}
{{=prettydate(dd,T)}} {{pass}}
{{for day in xrange(1,31):}} {{dd=datetime.datetime.strptime('2012-07-%s 10:00:00'%day, '%Y-%m-%d %H:%M:%S')}}
{{=prettydate(dd,T)}} {{pass}}
{{=BEAUTIFY(response._vars)}}

Reply via email to