How to convert a word to its plural form in AnqiCMS templates?
pluralize
The filter can convert a word to its plural form based on quantity.
Usage Instructions
pluralize
How to use the filter:
{{ obj|pluralize:"复数附加词" }}
pluralize
You need to specify the current quantity and add the plural word. Supports 0 to 2 words, when using 2 words, it should be used,
separated.
such ascustomer
then it can be written like this:
customer{{ 1|pluralize }}
# 显示结果
customer
Here is an example demonstration
customer{{ 0|pluralize }}
customer{{ 1|pluralize }}
customer{{ 2|pluralize }}
cherr{{ 0|pluralize:"y,ies" }}
cherr{{ 1|pluralize:"y,ies" }}
cherr{{ 2|pluralize:"y,ies" }}
walrus{{ 0|pluralize:"es" }}
walrus{{ 1|pluralize:"es" }}
walrus{{ simple.number|pluralize:"es" }}
# 显示结果
customers
customer
customers
cherries
cherry
cherries
walruses
walrus
walruses