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

Module i18n

source code

internationalization helpers


Version: $Rev: 6693 $

Classes [hide private]
  FancyEqMixin
  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.
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='flumotion')
Return a function that takes a format string or tuple, and additional format args, and creates a Translatable from it.
source code
 
getLL()
Return the (at most) two-letter language code set for message translation.
source code
 
installGettext()
Sets up gettext so that the program gets translated.
source code
Function Details [hide private]

gettexter(domain='flumotion')

source code 

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

Example:

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

installGettext()

source code 

Sets up gettext so that the program gets translated. Use this in any Flumotion end-user application that needs translations.