在使用 Django 模板复数过滤器的句子中定义 is/are 的最佳方法是什么?例如:
<p>
Your item{{ items|length|pluralize }}
is/are
currently being processed and will ship soon.
</p>
在使用 Django 模板复数过滤器的句子中定义 is/are 的最佳方法是什么?例如:
<p>
Your item{{ items|length|pluralize }}
is/are
currently being processed and will ship soon.
</p>
如上一个示例所示pluralize
,您可以尝试
Your item{{ items|length|pluralize:" is,s are" }}
currently being processed and will ship soon.
使用pluralize
with Alternative suffix 参数。
<p>
Your item{{ items|length|pluralize }}
{{ items|length|pluralize:"is,are" }}
currently being processed and will ship soon.
</p>