pluralize
Produces the singular or plural variant of a string depending on a provided numerical value.
Note
The pluralize helper follows English pluralization conventions to decide the appropriate string output. It's advised against using this helper for languages other than English, as it might generate inaccurate plural forms.
Parameters
num{Number}: The input number. This parameter is required.singular{String}: The singular form. This parameter is required.plural{String}: The plural form. This parameter is required.returns{String}: The resulting string.
Usage
{{ pluralize num singular plural }}
Example
{{ pluralize 3 'bird' 'birds' }} <!-- Outputs: 'birds' -->
Was this article helpful to you?