class documentation

class NullTranslations(gettext.NullTranslations, object):

Known subclasses: babel.support.Translations

View In Hierarchy

Undocumented

Constant CONTEXT​_ENCODING Undocumented
Constant DEFAULT​_DOMAIN 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 No summary
Method pgettext No summary
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 No summary
Method upgettext No summary
Instance Variable ​_catalog Undocumented
Instance Variable ​_domains Undocumented
Instance Variable domain Undocumented
Instance Variable files Undocumented
Instance Variable plural Undocumented
CONTEXT_ENCODING: str =

Undocumented

Value
'%s\x04%s'
DEFAULT_DOMAIN =

Undocumented

Value
None
def __init__(self, fp=None):
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()').
Parameters
fpa file-like object (ignored in this class)
def dgettext(self, domain, message):
Like gettext(), but look the message up in the specified domain.
def dngettext(self, domain, singular, plural, num):
Like ngettext(), but look the message up in the specified domain.
def dnpgettext(self, domain, context, singular, plural, num):
Like npgettext, but look the message up in the specified domain.
def dpgettext(self, domain, context, message):
Like pgettext(), but look the message up in the specified domain.
def ldgettext(self, domain, message):
Like lgettext(), but look the message up in the specified domain.
def ldngettext(self, domain, singular, plural, num):
Like lngettext(), but look the message up in the specified domain.
def ldnpgettext(self, domain, context, singular, plural, num):
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, context, message):
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, singular, plural, num):
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, message):
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, singular, plural, num):

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, message):
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, message):
Like ugettext(), but look the message up in the specified domain.
def udngettext(self, domain, singular, plural, num):
Like ungettext() but look the message up in the specified domain.
def udnpgettext(self, domain, context, singular, plural, num):
Like unpgettext, but look the message up in the specified domain.
def udpgettext(self, domain, context, message):
Like upgettext(), but look the message up in the specified domain.
def unpgettext(self, context, singular, plural, num):

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, message):
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.
_catalog: dict =

Undocumented

_domains: dict =

Undocumented

domain =

Undocumented

files =

Undocumented

plural =

Undocumented