ngettext_lazy
A lazy version of ngettext that delays the translation of singular and plural strings until they are accessed as a string, typically used for pluralization in translated content.
def ngettext_lazy(
singular: string,
plural: string,
number: integer|string = None
) - > LazyString
Creates a lazy-evaluated version of ngettext for translating strings that vary based on a numeric count. Use this when defining pluralizable strings in global scopes or class attributes where the active language or count is not yet determined.
Parameters
| Name | Type | Description |
|---|---|---|
| singular | string | The translation key for the singular form of the message. |
| plural | string | The translation key for the plural form of the message. |
| number | `integer | string` = None |
Returns
| Type | Description |
|---|---|
LazyString | A proxy object that evaluates to the translated singular or plural string only when it is accessed or rendered. |