On Tue, Jun 9, 2009 at 10:40 PM, Sasha<[email protected]> wrote:
>
> thanks for looking at this. I'm a little concerned with this solution.
> It only lets you pass args to formatters, but not have first-class
> sections.
Yeah, as mentioned, I don't think it's a full solution, but will be
useful in limited circumstances. It's free anyway since it requires
no change to the language.
>
> A good example would be somewhere that you want to have different
> texts for singular versus plural. For instance, a common web time
> pattern.
>
> < 1 hour - 'About an hour ago"
>> 1 hour - "{n} hours ago"
>
> The predicate approach on the other hand, look pretty cool.
Yes, that's a good use case.
I found that Django does this with {% plural %}
http://www.google.com/codesearch?hl=en&lr=&q=\{%25\splural\s%25\}&sbtn=Search
(In addition to having the |pluralize filter/formatter)
What templating system are you using now, and how do you express this?
thanks,
Andy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JSON
Template" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/json-template?hl=en
-~----------~----~----~----~------~----~------~--~---