[web2py] Re: error gluon/sqlhtml.py?
In controller: T(text %s % value) - LazyT obj instance T(text %s) % value - str obj But in views, when the return value is used (i.e. doing =value) this is the output: =T(text %s % value) - translated and interpolated text =T(text %s) % value - translated and interpolated text Wich of these commands are recommended? (or both are valid?) On 14 dic, 05:20, Martin Weissenboeck mweis...@gmail.com wrote: 2011/12/13 Bruno Rocha rochacbr...@gmail.com On Wed, Dec 7, 2011 at 12:40 PM, Martin Weissenboeck mweis...@gmail.comwrote: message = error or T('%(nrows)s records found') % dict(nrows=nrows) I think we cannot do the above (unless things have changed) T(..) gives us a LazyT object which cannot be interpolated as a string, because o that we need to interpolate the string before passing it to T(..) For me the right is T(a placeholder %(key)s % dict(key=value) ) But every new value of value produces in a new entry in the translation file. Martin
[web2py] Re: error gluon/sqlhtml.py?
Nevermind my last post, it is explained in the book, but here is an ambiguous book's passage: Concatenating translation translated strings and normal strings is possible: 1. T(blah ) + name + T( blah) # invalid! but the opposite no: 1. name + T( blah) # invalid! I cannot see by reading this examples wich is the correct concatenation. Should the first comment read valid! instead of invalid!?
[web2py] Re: error gluon/sqlhtml.py?
They both seem to work in the shell. On Wednesday, December 14, 2011 8:29:56 PM UTC-5, Alan Etkin wrote: Nevermind my last post, it is explained in the book, but here is an ambiguous book's passage: Concatenating translation translated strings and normal strings is possible: 1. T(blah ) + name + T( blah) # invalid! but the opposite no: 1. name + T( blah) # invalid! I cannot see by reading this examples wich is the correct concatenation. Should the first comment read valid! instead of invalid!?
Re: [web2py] Re: error gluon/sqlhtml.py?
yes, the new code is in 1.99.3 2011/12/7 Anthony abasta...@gmail.com I think it has already been changed in trunk -- can you check it there? On Wednesday, December 7, 2011 9:40:28 AM UTC-5, mweissen wrote: I think line 1566 of gluon/sqlhtml.py message = error or T('%(nrows)s records found' % dict(nrows=nrows)) should be message = error or T('%(nrows)s records found') % dict(nrows=nrows) Regards, Martin
[web2py] Re: error gluon/sqlhtml.py?
I think it has already been changed in trunk -- can you check it there? On Wednesday, December 7, 2011 9:40:28 AM UTC-5, mweissen wrote: I think line 1566 of gluon/sqlhtml.py message = error or T('%(nrows)s records found' % dict(nrows=nrows)) should be message = error or T('%(nrows)s records found') % dict(nrows=nrows) Regards, Martin