[web2py] Re: error gluon/sqlhtml.py?

2011-12-14 Thread Anthony
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!"?
>
>

[web2py] Re: error gluon/sqlhtml.py?

2011-12-14 Thread Alan Etkin
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?

2011-12-14 Thread Alan Etkin
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  wrote:
> 2011/12/13 Bruno Rocha 
>
>
>
> > On Wed, Dec 7, 2011 at 12:40 PM, Martin Weissenboeck 
> > wrote:
>
> >> 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
>
>


Re: [web2py] Re: error gluon/sqlhtml.py?

2011-12-12 Thread Martin Weissenboeck
yes, the new code is in 1.99.3

2011/12/7 Anthony 

> 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?

2011-12-07 Thread Anthony
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 
>