class Translations(NullTranslations, gettext.GNUTranslations):
Class Method | load |
Load translations from the given directory. |
Method | add |
Add the given translations to the catalog. |
Method | merge |
Merge the given translations into the catalog. |
Constant | DEFAULT_DOMAIN |
Undocumented |
Method | __init__ |
Initialize the translations catalog. |
Method | __repr__ |
Undocumented |
Instance Variable | domain |
Undocumented |
Inherited from NullTranslations
:
Constant | CONTEXT_ENCODING |
Undocumented |
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 | files |
Undocumented |
Instance Variable | plural |
Undocumented |
Parameters | |
dirname | the directory containing the MO files |
locales | the list of locales in order of preference (items in
this list can be either Locale objects or locale
strings) |
domain | the message domain (default: 'messages') |
Add the given translations to the catalog.
If the domain of the translations is different than that of the current catalog, they are added as a catalog that is only accessible by the various d*gettext functions.
Parameters | |
translations | the Translations instance with the messages to
add |
merge | whether translations for message domains that have already been added should be merged with the existing translations |
Merge the given translations into the catalog.
Message translations in the specified catalog override any messages with the same identifier in the existing catalog.
Parameters | |
translations | the Translations instance with the messages to
merge |
babel.support.NullTranslations.__init__
Parameters | |
fp | the file-like object the translation should be read from |
domain | the message domain (default: 'messages') |