6

What is the best way to define is/are in a sentence that uses the Django template pluralize filter? For example:

<p>
    Your item{{ items|length|pluralize }}
    is/are
    currently being processed and will ship soon.
</p>
kd88
  • 1,054
  • 10
  • 21
tomcounsell
  • 4,991
  • 3
  • 34
  • 34

2 Answers2

11

As shown in last example of pluralize, you can try

Your item{{ items|length|pluralize:" is,s are" }}
currently being processed and will ship soon.
fureigh
  • 113
  • 2
  • 5
Rohan
  • 52,392
  • 12
  • 90
  • 87
4

Use the pluralize with alternative suffix argument.

<p>
    Your item{{ items|length|pluralize }}
    {{ items|length|pluralize:"is,are" }}
    currently being processed and will ship soon.
</p>
falsetru
  • 357,413
  • 63
  • 732
  • 636