Request

Liquid “Pluralize” string filter

  • Liquid

Request to get the pluralize filter implimented into Treepl.


{% assign itemCount = "3" %}
{{ itemCount | pluralize: 'item', 'items' }}

Output:
3 items

Example from: String filters 1

Also with the option to use variables ie:


{% assign term = "minute" %}
{% assign terms = "minutes" %}
{% assign time = 50 %}

{% assign prettyTimePlural = time | pluralize: term, terms %}
{% assign prettyTime = time | append: " " | append: prettyTimePlural %}

Output: {{ prettyTime }}
50 Minutes