Package orm2 :: Package ui :: Package xist :: Module i18n
[hide private]
[frames] | no frames]

Module i18n

source code



Functions [hide private]
  translate(txt, context)
Someday soon, this function will return a translation for unicode_string suitable for context.
  translate_template(context, template, *args, **kw)
The i18n version of the % opperator: template must be a unicode string, which will be translated (including the placeholders) and then applied to the data passed as either positional arguments or key word arguments.
  _(txt, context)
Someday soon, this function will return a translation for unicode_string suitable for context.

Function Details [hide private]

translate(txt, context)

source code 
Someday soon, this function will return a translation for unicode_string suitable for context.
  • If txt is a unicode string it will translate it and return a xsc.Text instance to be used with xist
  • If a xist DOM tree is supplied, it will recursively traverse it and translate all CharachterData instance's content that are not marked with a __translated__ Flag.

translate_template(context, template, *args, **kw)

source code 

The i18n version of the % opperator: template must be a unicode string, which will be translated (including the placeholders) and then applied to the data passed as either positional arguments or key word arguments.

Example:
  >>> translate_template(context, '%s %s', one, two)
  '<content of one> <content of two>'
  >>> translate_template(context, '%(one)s %(two)s', one='1', two='2')
  '1 2'

_(txt, context)

source code 
Someday soon, this function will return a translation for unicode_string suitable for context.
  • If txt is a unicode string it will translate it and return a xsc.Text instance to be used with xist
  • If a xist DOM tree is supplied, it will recursively traverse it and translate all CharachterData instance's content that are not marked with a __translated__ Flag.