Skip to main content

ngettext

Return a string of the translation of either the singular or plural, based on the number.

def ngettext(
singular: string,
plural: string,
number: integer
) - > string

Return a string of the translation of either the singular or plural, based on the number.

Parameters

NameTypeDescription
singularstringThe default singular form of the message to be translated
pluralstringThe default plural form of the message to be translated
numberintegerThe numerical value used to determine whether to use the singular or plural translation

Returns

TypeDescription
stringThe translated string in either singular or plural form based on the provided count