npgettext_lazy
Returns a lazy-evaluated version of npgettext, allowing for pluralized translations with a specific context that are resolved only when the result is accessed as a string.
def npgettext_lazy(
context: str,
singular: str,
plural: str,
number: int
) - > LazyString
Lazily resolves a pluralized translation within a specific context, deferring the lookup until the string is actually used in a rendering context.
Parameters
| Name | Type | Description |
|---|---|---|
| context | str | The translation context used to disambiguate identical strings (e.g., 'verb' vs 'noun'). |
| singular | str | The default singular form of the message to be translated. |
| plural | str | The default plural form of the message to be translated. |
| number | int | The variable used to determine which form (singular or plural) to use based on language-specific pluralization rules. |
Returns
| Type | Description |
|---|---|
LazyString | A proxy object that evaluates to the translated string corresponding to the provided context and count when accessed. |