Translates the text of element plus the text of all child elements. If attr is present
this is used to provide the locale name; if not then value provided by get_locale is used.
For example:
<div lang="">
this is a test
<a href="de">testing</a>
</div>
The string 'this is a test' is rendered by the locale provided by get_locale, the
string 'testing' by the German locale.
Possible use in Kid template:
<?python
from turbogears.i18n import translate
?>
<translate xmlns:py="http://purl.org/kid/ns#" py:match="item.attrib.has_key('lang')"
py:replace="translate(item)"/>
<h1 lang="">Welcome!</h1>
@param item: element to be translated
@type item: ElementTree element
@param attr: attribute name used to store locale, if any
|