Package flumotion :: Package common :: Module messages :: Class Translator
[hide private]

Class Translator

source code

log.Loggable --+
               |
              Translator

I translate translatables and messages. I need to be told where locale directories can be found for all domains I need to translate for.

Instance Methods [hide private]
 
__init__(self) source code
 
addLocaleDir(self, domain, dir)
Add a locale directory for the given text domain.
source code
 
translateTranslatable(self, translatable, lang=None)
Translate a translatable object, in the given language.
source code
 
translate(self, message, lang=None)
Translate a message, in the given language.
source code

Inherited from log.Loggable: __providedBy__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'translator'
Implementors can provide a category to log their messages under.

Inherited from log.Loggable: __implemented__, __provides__

Method Details [hide private]

translateTranslatable(self, translatable, lang=None)

source code 

Translate a translatable object, in the given language.

Parameters:
  • lang - language code (or the current locale if None)