Skip to main content

do_ntranslate

Translates a pluralizable string by delegating to the active translation object or a default translation instance based on the provided translation function and count.

def do_ntranslate(
singular: string,
plural: string,
number: integer,
translation_function: string
) - > string

Handles plural-aware translations by delegating to the currently active translation object or falling back to the default system language.

Parameters

NameTypeDescription
singularstringThe default singular form of the message to be translated.
pluralstringThe default plural form of the message to be translated.
numberintegerThe count used to determine which plural form of the translation should be selected.
translation_functionstringThe name of the method to invoke on the translation object, such as 'ngettext' or 'npgettext'.

Returns

TypeDescription
stringThe translated string corresponding to the provided number, retrieved using the specified translation method.