Re: [web2py] prettydate question

2012-07-26 Thread Vladyslav Kozlovskyy

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)}}


Re: [web2py] prettydate question

2012-07-25 Thread Asimionese Alexandru


On Wednesday, July 25, 2012 11:48:34 AM UTC+3, ctrlSoft wrote:
>
>
>
> On Tuesday, July 24, 2012 5:58:16 PM UTC+3, dbdeveloper wrote:
>>
>>  ctrlSoft, is issue still present ?
>>
>> Vladyslav Kozlovskyy (Ukraine)
>>
>> 23.07.12 13:32, ctrlSoft написав(ла):
>>  
>> datetime format is: 2012-07-18 10:00:00  
>>  
>>  hi in view i have following code:
>> {{=prettydate(row.deadline,T)}}
>>
>>  but result is :
>> %d days ago 
>>  %d days ago  
>> %d days ago   
>>  %d days ago   
>>  ...
>> 1 week ago
>> 1 week ago
>> ...
>> %d weeks ago 
>>  %d weeks ago 
>>  %d weeks ago 
>>  
>>  how to display 
>> 4 days ago
>> 5 days ago
>> ...
>> 2 weeks ago
>> 3 weeks ago
>> ... 
>> ...
>>
>>  -- 
>>  
>>  
>> ( web2py version is from trunk.) i tried Bruno solution 
>> {{=prettydate(row.deadline, lambda x: x)}}  and it works...
>>
>>  bu i need with translation, {{=prettydate(row.deadline, lambda x: 
> x)}}, i have all transaltion files in laguages folder
>  
>

-- 





Re: [web2py] prettydate question

2012-07-25 Thread ctrlSoft
browser is set up to english, but in model i do T.force('ro'). without 
forced translation result is the same

-- 



# coding: utf8
{
'!=': '!=',
'!langcode!': 'ro',
'!langname!': 'Rom?n?',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" (actualizeaz?) este o expresie op?ional? precum "c?mp1=\'valoare_nou?\'". Nu pute?i actualiza sau ?terge rezultatele unui JOIN',
'%(nrows)s records found': '%(nrows)s ?nregistr?ri g?site',
'%d hours ago': '%d hours ago',
'%d weeks ago': '%d saptamani in urma',
'%d-%m-%Y': '%d-%m-%Y',
'%d-%m-%Y %H:%M:%S': '%d-%m-%Y %H:%M:%S',
'%s %%{row} deleted': '%s linii ?terse',
'%s %%{row} updated': '%s linii actualizate',
'%s selected': '%s selectat(e)',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'(something like "it-it")': '(ceva ce seam?n? cu "it-it")',
'1 month ago': '1 luna in urma',
'1 week ago': '1 saptamana in urma',
'<': '<',
'<=': '<=',
'=': '=',
'>': '>',
'>=': '>=',
'A new version of web2py is available': 'O nou? versiune de web2py este disponibil?',
'A new version of web2py is available: %s': 'O nou? versiune de web2py este disponibil?: %s',
'About': 'Despre',
'about': 'despre',
'About application': 'Despre aplica?ie',
'Access Control': 'Control acces',
'Add': 'Adaug?',
'additional code for your application': 'cod suplimentar pentru aplica?ia dvs.',
'admin disabled because no admin password': 'administrare dezactivat? deoarece parola de administrator nu a fost furnizat?',
'admin disabled because not supported on google app engine': 'administrare dezactivat? deoarece func?ionalitatea nu e suportat pe Google App Engine',
'admin disabled because unable to access password file': 'administrare dezactivat? deoarece nu exist? acces la fi?ierul cu parole',
'Admin is disabled because insecure channel': 'Adminstrarea este dezactivat? deoarece conexiunea nu este sigur?',
'Admin is disabled because unsecure channel': 'Administrarea este dezactivat? deoarece conexiunea nu este securizat?',
'Administration': 'Administrare',
'Administrative Interface': 'Interfa?? administrare',
'Administrator Password:': 'Parol? administrator:',
'Adresa': 'Adresa',
'Ai uitat parola?': 'Ai uitat parola?',
'Ajax Recipes': 'Re?ete Ajax',
'And': '?i',
'and rename it (required):': '?i renumi?i (obligatoriu):',
'and rename it:': ' ?i renumi?i:',
'appadmin': 'appadmin',
'appadmin is disabled because insecure channel': 'appadmin dezactivat deoarece conexiunea nu e sigur?',
'application "%s" uninstalled': 'aplica?ia "%s" a fost dezinstalat?',
'application compiled': 'aplica?ia a fost compilat?',
'application is compiled and cannot be designed': 'aplica?ia este compilat? ?i nu poate fi editat?',
'Are you sure you want to delete file "%s"?': 'Sigur ?terge?i fi?ierul "%s"?',
'Are you sure you want to delete this object?': 'Sigur ?terge?i acest obiect?',
'Are you sure you want to uninstall application "%s"': 'Sigur dezinstala?i aplica?ia "%s"',
'Are you sure you want to uninstall application "%s"?': 'Sigur dezinstala?i aplica?ia "%s"?',
'ATTENTION: Login requires a secure (HTTPS) connection or running on localhost.': 'ATEN?IE: Nu v? pute?i conecta dec?t utiliz?nd o conexiune securizat? (HTTPS) sau rul?nd aplica?ia pe computerul local.',
'ATTENTION: TESTING IS NOT THREAD SAFE SO DO NOT PERFORM MULTIPLE TESTS CONCURRENTLY.': 'ATEN?IE: Nu pute?i efectua mai multe teste o dat? deoarece lansarea ?n execu?ie a mai multor subpocese nu este sigur?.',
'ATTENTION: you cannot edit the running application!': 'ATEN?IE: nu pute?i edita o aplica?ie ?n curs de execu?ie!',
'Autentificare': 'Autentificare',
'Authentication': 'Autentificare',
'Autoritatea Contractanta': 'Autoritatea Contractanta',
'Available databases and tables': 'Baze de date ?i tabele disponibile',
'Back': '?napoi',
'Buy this book': 'Cump?r? aceast? carte',
'cache': 'cache',
'Cache Keys': 'Chei cache',
'cache, errors and sessions cleaned': 'cache, erori ?i sesiuni golite',
'Cannot be empty': 'Nu poate fi vid',
'Cannot compile: there are errors in your app.Debug it, correct errors and try again.': 'Compilare imposibil?: aplica?ia con?ine erori. Deboga?i aplica?ia ?i ?ncerca?i din nou.',
'cannot create file': 'fi?ier imposibil de creat',
'cannot upload file "%(filename)s"': 'imposibil de ?nc?rcat fi?ierul "%(filename)s"',
'Categoria': 'Categoria',
'Change Password': 'Schimbare parol?',
'Change password': 'Schimbare parol?',
'change password': 'schimbare parol?',
'check all': 'co?a?i tot',
'Check to delete': 'Co?a?i pentru a ?terge',
'clean': 'golire',
'Clear': 'Gole?te',
'click to check for upgrades': 'Clic pentru a verifica dac? exist? upgrade-uri',
'Client IP': 'IP client',
'Cod Banca': 'Cod Banca',
'Cod Fiscal': 'Cod Fiscal',
'Community': 'Comunitate',
'compile': 'compilare',
'compiled application removed': 'aplica?ia compilat? a fost ?tears?',
'Components and Plugins': 'Componente ?i plugin-uri',
'Cont de decontare': 'Cont de decontare',
'Cont Trezorerial'

Re: [web2py] prettydate question

2012-07-25 Thread Massimo Di Pierro
Can you post the language file that you are using? What language is your 
browser set up to?

Massimo

On Wednesday, 25 July 2012 06:05:27 UTC-5, ctrlSoft wrote:
>
> but with translation wont work, i have al translation files in languages 
> folder.

-- 





Re: [web2py] prettydate question

2012-07-25 Thread ctrlSoft
but with translation wont work, i have al translation files in languages 
folder.

-- 





Re: [web2py] prettydate question

2012-07-25 Thread ctrlSoft


On Tuesday, July 24, 2012 5:58:16 PM UTC+3, dbdeveloper wrote:
>
>  ctrlSoft, is issue still present ?
>
> Vladyslav Kozlovskyy (Ukraine)
>
> 23.07.12 13:32, ctrlSoft написав(ла):
>  
> datetime format is: 2012-07-18 10:00:00  
>  
>  hi in view i have following code:
> {{=prettydate(row.deadline,T)}}
>
>  but result is :
> %d days ago 
>  %d days ago  
> %d days ago   
>  %d days ago   
>  ...
> 1 week ago
> 1 week ago
> ...
> %d weeks ago 
>  %d weeks ago 
>  %d weeks ago 
>  
>  how to display 
> 4 days ago
> 5 days ago
> ...
> 2 weeks ago
> 3 weeks ago
> ... 
> ...
>
>  -- 
>  
>  
> ( web2py version is from trunk.) i tried Bruno solution 
> {{=prettydate(row.deadline, lambda x: x)}}  and it works...
>
>  
 

-- 





Re: [web2py] prettydate question

2012-07-24 Thread Vladyslav Kozlovskyy

ctrlSoft, is issue still present ?

Vladyslav Kozlovskyy (Ukraine)

23.07.12 13:32, ctrlSoft ???(??):

datetime format is: 2012-07-18 10:00:00

hi in view i have following code:
{{=prettydate(row.deadline,T)}}

but result is :
%d days ago
%d days ago
%d days ago
%d days ago
...
1 week ago
1 week ago
...
%d weeks ago
%d weeks ago
%d weeks ago

how to display
4 days ago
5 days ago
...
2 weeks ago
3 weeks ago
...
...

--





--





[web2py] prettydate question

2012-07-23 Thread ctrlSoft
datetime format is: 2012-07-18 10:00:00  

hi in view i have following code:
{{=prettydate(row.deadline,T)}}

but result is :
%d days ago 
%d days ago  
%d days ago   
%d days ago   
...
1 week ago
1 week ago
...
%d weeks ago 
%d weeks ago 
%d weeks ago 

how to display 
4 days ago
5 days ago
...
2 weeks ago
3 weeks ago
... 
...

--