npgettext
Returns the plural form of a message in a specific context by calling the ngettext function.
def npgettext(
context: string,
singular: string,
plural: string,
number: integer
) - > string
Translates a message with a specific context and handles pluralization based on a numeric value.
Parameters
| Name | Type | Description |
|---|---|---|
| context | string | The context string used to disambiguate identical messages in different parts of the application. |
| singular | string | The default singular form of the message to be translated. |
| plural | string | The default plural form of the message to be translated. |
| number | integer | The numeric value used to determine whether the singular or plural form of the message should be returned. |
Returns
| Type | Description |
|---|---|
string | The translated string in either singular or plural form, appropriate for the provided count and context. |