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

Module messages

source code

support for serializable translatable messages from component/manager to admin

Classes [hide private]
  Translatable
I represent a serializable translatable gettext msg.
  TranslatableSingular
I represent a translatable gettext msg in the singular form.
  TranslatablePlural
I represent a translatable gettext msg in the plural form.
  Translator
I translate translatables and messages.
  Message
I am a message to be shown in a UI.
  Result
I am used in worker checks to return a result.
Functions [hide private]
 
N_(format)
Mark a singular string for translation, without translating it.
source code
 
ngettext(singular, plural, count)
Mark a plural string for translation, without translating it.
source code
 
gettexter(domain)
Return a function that takes a format string or tuple, and additional format args, and creates a Translatable from it.
source code
 
Error(*args, **kwargs)
Create a Message at ERROR level, indicating a failure that needs intervention to be resolved.
source code
 
Warning(*args, **kwargs)
Create a Message at WARNING level, indicating a potential problem.
source code
 
Info(*args, **kwargs)
Create a Message at INFO level.
source code
Variables [hide private]
  ERROR = 1
  WARNING = 2
  INFO = 3
Function Details [hide private]

gettexter(domain)

source code 

Return a function that takes a format string or tuple, and additional format args, and creates a Translatable from it.

Example:

   T_ = messages.gettexter('flumotion')
   t = T_(N_("Could not find '%s'."), file)
Parameters:
  • domain - the gettext domain to create translatables for.