Module egg_translations :: Class DefaultTranslations
[hide private]

Class DefaultTranslations

source code

gettext.NullTranslations --+    
                           |    
     gettext.GNUTranslations --+
                               |
                              DefaultTranslations

Instance Methods [hide private]
 
ugettext(self, message, *args)
Extends GNUTranslations ugettext method adding the ability to pass a default argument which will be returned if no localization is found for the message key.
source code

Inherited from gettext.GNUTranslations: gettext, lgettext, lngettext, ngettext, ungettext

Inherited from gettext.GNUTranslations (private): _parse

Inherited from gettext.NullTranslations: __init__, add_fallback, charset, info, install, output_charset, set_output_charset

Class Variables [hide private]

Inherited from gettext.GNUTranslations: BE_MAGIC, LE_MAGIC

Method Details [hide private]

ugettext(self, message, *args)

source code 
Extends GNUTranslations ugettext method adding the ability to pass a default argument which will be returned if no localization is found for the message key.
Parameters:
  • message (unicode or ASCII {str}) - unicode or {str} message key used to lookup a localization
  • args (list) - An optional argument which if passed will be returned if no localzation found for message. The type of the return value in the args list has no limitations.
Returns:
unicode localized message or either the original message argument or the default value in args if no localization found.
Overrides: gettext.GNUTranslations.ugettext