_n()

Twig function of the framework; its result is escaped like any value.

{{ _n(singular, plural, number) }}

The singular or plural form of a text for a number, translated.

<p>{{ _n('%d event', '%d events', events|length)|format(events|length) }}</p>
ParameterTypeDefaultDescription
singularstringrequiredThe singular form in English.
pluralstringrequiredThe plural form in English.
numberintrequiredThe number that decides the form.

Returns string