Here's a phrase I have to make translateable:
Poll ends in 2 hours 23 minutes
This string must have the main phrase and 'hour' and 'minute' in singular and plural forms.
{% blocktrans %}Poll ends in {{ poll.expire_hours }} ??? {{ poll.expire_minutes }} ???{% endblocktrans %}
What do I put then instead of ???
?
Solution: made a simple tag that takes parameters like this:
{% readable_interval _('Poll ends in %s') poll.expire %}
and inside it converts the poll.expire
(timedelta
) into a readable text ('X days'/'N hours and M minutes'/'N hours'/'M minutes'/'Less than a minute'). All the strings that are coded in the tag code, are i18-ized.