Skip to main content

npgettext

No overview available.

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

Fetches the plural form of a message translation based on a specific context and numeric value.

Parameters

NameTypeDescription
contextstringThe translation context used to disambiguate identical strings in different parts of the application.
singularstringThe default singular form of the message to be translated.
pluralstringThe default plural form of the message to be translated.
numberintegerThe numeric value used to determine whether the singular or plural form of the translation should be returned.

Returns

TypeDescription
stringThe translated string in either singular or plural form, determined by the provided number and context.