npgettext
Translates a message with a specific context and handles pluralization by prepending the context to the singular and plural strings before looking up the translation.
def npgettext(
context: string,
singular: string,
plural: string,
number: integer
) - > string
Translates a message with a specific context, providing pluralization support based on the provided count.
Parameters
| Name | Type | Description |
|---|---|---|
| context | string | The translation context used to disambiguate identical strings 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 numerical value used to determine whether to use the singular or plural form of the translation. |
Returns
| Type | Description |
|---|---|
string | The translated string in the appropriate singular or plural form for the given context, or the original source string if no translation is found. |