Pluralization and styles

43 views
Skip to first unread message

Louis Amon

unread,
Apr 29, 2014, 2:28:57 PM4/29/14
to web...@googlegroups.com
I'm trying to print something like that in my view :
31 results found

(notice the bold number)

I used the pluralization engine like this:
T('%s  %%{result} %%{found}', symbols=num_offers)

And it gives the right string but obviously not styled.

Other attempts:
T(XML('<strong>%s</strong>)' + '  %%{result} %%{found}', symbols=num_offers)
T(STRONG('%s')+'  %%{result} %%{found}', symbols=num_offers)
STRONG(num_offers) + T(' %%{result} %%{found}', symbols=num_offers)

None of these are working for me.

What's the right way to do this ?
 

vld...@gmail.com

unread,
Apr 30, 2014, 12:28:40 PM4/30/14
to web...@googlegroups.com
you can try to use markmin in T for styling. You need to write:

T.M('*%s* %%{result} %%{found}', symbols=num_offers)


29.04.14 21:28, Louis Amon написав(ла):
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Louis Amon

unread,
May 6, 2014, 9:11:00 AM5/6/14
to web...@googlegroups.com
I made a slight modification (**%s** instead of *%s*) and then it worked !

Thanks
Reply all
Reply to author
Forward
0 new messages