Exemplo n.º 1
0
 def enable_i18n_for_template(template):
     translations = Translator(translator)
     translations.setup(template)
Exemplo n.º 2
0
 def enable_i18n_for_template(template):
     translations = Translator(DummyTranslators())
     translations.setup(template)
     template.filters.insert(0, translations)
Exemplo n.º 3
0
 def enable_i18n_for_template(template):
     translations = Translator(pylons.translator)
     translations.setup(template)
Exemplo n.º 4
0
<tr py:for="row in table">
<td py:for="c in row.values()" py:content="c"/>
</tr>
</table>
""")

genshi_tmpl_i18n = MarkupTemplate("""
<table xmlns:py="http://genshi.edgewall.org/"
       xmlns:i18n="http://genshi.edgewall.org/i18n">
<tr py:for="row in table">
<td py:for="c in row.values()">${c}</td>
</tr>
</table>
""")
t = Translator(DummyTranslations())
t.setup(genshi_tmpl_i18n)

genshi_tmpl2 = MarkupTemplate("""
<table xmlns:py="http://genshi.edgewall.org/">$table</table>
""")

genshi_text_tmpl = NewTextTemplate("""
<table>
{% for row in table %}<tr>
{% for c in row.values() %}<td>$c</td>{% end %}
</tr>{% end %}
</table>
""")

if DjangoTemplate:
    django_tmpl = DjangoTemplate("""