Specialized gettext Subclasses (hoshi.translations)ΒΆ
These classes are used internally to modify the behavior of gettext.
Most applications would not need to touch this module directly.
- exception hoshi.translation.TranslationMissingError(msg)[source]
Bases:
ExceptionAn exception that is raised if an attempt to translate a string did not find a suitable translation to return. This may happen because the
msgiddoes not exist in the template, or if the translation in the catalog is blank.
- class hoshi.translation.FailingFallback(fp=None)[source]
Bases:
gettext.NullTranslationsgettext.NullTranslationssubclass which simply raises aTranslationMissingError. When used as a Fallback Translation, this results in the exception being thrown whenever translations are missing.- gettext(message)[source]
- class hoshi.translation.StrictTranslations(*args, **kwargs)[source]
Bases:
gettext.GNUTranslations,objectgettext.GNUTranslationssubclass which uses theFailingFallbackThis is used by thehoshi.TranslationManagerto provide its functionality.