class documentation

Undocumented

Method __init__ Initialize a simple translations class which is not backed by a real catalog. Behaves similar to gettext.NullTranslations but also offers Babel's on *gettext methods (e.g. 'dgettext()').
Method dgettext Like ``gettext()``, but look the message up in the specified domain.
Method dngettext Like ``ngettext()``, but look the message up in the specified domain.
Method dnpgettext Like ``npgettext``, but look the message up in the specified `domain`.
Method dpgettext Like `pgettext()`, but look the message up in the specified `domain`.
Method ldgettext Like ``lgettext()``, but look the message up in the specified domain.
Method ldngettext Like ``lngettext()``, but look the message up in the specified domain.
Method ldnpgettext Equivalent to ``dnpgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.
Method ldpgettext Equivalent to ``dpgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.
Method lnpgettext Equivalent to ``npgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.
Method lpgettext Equivalent to ``pgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.
Method npgettext Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is an 8-bit string encoded with the catalog's charset encoding, if known.
Method pgettext Look up the `context` and `message` id in the catalog and return the corresponding message string, as an 8-bit string encoded with the catalog's charset encoding, if known. If there is no entry in the catalog for the `message` id and `context` , and a fallback has been set, the look up is forwarded to the fallback's ``pgettext()`` method...
Method udgettext Like ``ugettext()``, but look the message up in the specified domain.
Method udngettext Like ``ungettext()`` but look the message up in the specified domain.
Method udnpgettext Like ``unpgettext``, but look the message up in the specified `domain`.
Method udpgettext Like `upgettext()`, but look the message up in the specified `domain`.
Method unpgettext Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is a Unicode string.
Method upgettext Look up the `context` and `message` id in the catalog and return the corresponding message string, as a Unicode string. If there is no entry in the catalog for the `message` id and `context`, and a fallback has been set, the look up is forwarded to the fallback's ``upgettext()`` method...
Constant CONTEXT_ENCODING Undocumented
Constant DEFAULT_DOMAIN Undocumented
Instance Variable domain Undocumented
Instance Variable files Undocumented
Instance Variable plural Undocumented
Class Variable _fallback Undocumented
Class Variable _info Undocumented
Instance Variable _catalog Undocumented
Instance Variable _domains Undocumented
def __init__(self, fp: gettext._TranslationsReader|None = None): (source)

Initialize a simple translations class which is not backed by a real catalog. Behaves similar to gettext.NullTranslations but also offers Babel's on *gettext methods (e.g. 'dgettext()'). :param fp: a file-like object (ignored in this class)

def dgettext(self, domain: str, message: str) -> str: (source)

Like ``gettext()``, but look the message up in the specified domain.

def dngettext(self, domain: str, singular: str, plural: str, num: int) -> str: (source)

Like ``ngettext()``, but look the message up in the specified domain.

def dnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str: (source)

Like ``npgettext``, but look the message up in the specified `domain`.

def dpgettext(self, domain: str, context: str, message: str) -> str|object: (source)

Like `pgettext()`, but look the message up in the specified `domain`.

def ldgettext(self, domain: str, message: str) -> str: (source)

Like ``lgettext()``, but look the message up in the specified domain.

def ldngettext(self, domain: str, singular: str, plural: str, num: int) -> str: (source)

Like ``lngettext()``, but look the message up in the specified domain.

def ldnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str|bytes: (source)

Equivalent to ``dnpgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.

def ldpgettext(self, domain: str, context: str, message: str) -> (str|bytes)|object: (source)

Equivalent to ``dpgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.

def lnpgettext(self, context: str, singular: str, plural: str, num: int) -> str|bytes: (source)

Equivalent to ``npgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.

def lpgettext(self, context: str, message: str) -> (str|bytes)|object: (source)

Equivalent to ``pgettext()``, but the translation is returned in the preferred system encoding, if no other encoding was explicitly set with ``bind_textdomain_codeset()``.

def npgettext(self, context: str, singular: str, plural: str, num: int) -> str: (source)

Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is an 8-bit string encoded with the catalog's charset encoding, if known. If the message id for `context` is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's ``npgettext()`` method. Otherwise, when ``num`` is 1 ``singular`` is returned, and ``plural`` is returned in all other cases.

def pgettext(self, context: str, message: str) -> str|object: (source)

Look up the `context` and `message` id in the catalog and return the corresponding message string, as an 8-bit string encoded with the catalog's charset encoding, if known. If there is no entry in the catalog for the `message` id and `context` , and a fallback has been set, the look up is forwarded to the fallback's ``pgettext()`` method. Otherwise, the `message` id is returned.

def udgettext(self, domain: str, message: str) -> str: (source)

Like ``ugettext()``, but look the message up in the specified domain.

def udngettext(self, domain: str, singular: str, plural: str, num: int) -> str: (source)

Like ``ungettext()`` but look the message up in the specified domain.

def udnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str: (source)

Like ``unpgettext``, but look the message up in the specified `domain`.

def udpgettext(self, domain: str, context: str, message: str) -> str: (source)

Like `upgettext()`, but look the message up in the specified `domain`.

def unpgettext(self, context: str, singular: str, plural: str, num: int) -> str: (source)

Do a plural-forms lookup of a message id. `singular` is used as the message id for purposes of lookup in the catalog, while `num` is used to determine which plural form to use. The returned message string is a Unicode string. If the message id for `context` is not found in the catalog, and a fallback is specified, the request is forwarded to the fallback's ``unpgettext()`` method. Otherwise, when `num` is 1 `singular` is returned, and `plural` is returned in all other cases.

def upgettext(self, context: str, message: str) -> str: (source)

Look up the `context` and `message` id in the catalog and return the corresponding message string, as a Unicode string. If there is no entry in the catalog for the `message` id and `context`, and a fallback has been set, the look up is forwarded to the fallback's ``upgettext()`` method. Otherwise, the `message` id is returned.

CONTEXT_ENCODING: str = (source)

Undocumented

Value
'%s\x04%s'
DEFAULT_DOMAIN = (source)

Undocumented

Value
None

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented