How to convert a word into its plural form in the Anqi CMS template?
pluralizeThe filter can convert a word into its plural form based on the quantity.
Usage method
pluralizeHow to use the filter:
{{ obj|pluralize:"复数附加词" }}
pluralizeYou need to specify the current quantity and add the plural word. Supports 0 to 2 words, use 2 words when,separated.
such ascustomerIt can be written like this:
customer{{ 1|pluralize }}
# 显示结果
customer
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