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.com>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 > >