Skip to content
Myr

translate.py

This file

Path

examples/basic/translate.py

6 lines · 273 bytes · Python

Last changed by

moved example code aroundArmin Ronacherbefore adoption612b3a8

History of this file

Take it

moved example code aroundArmin Ronacherbefore adoption612b3a8

lines 1–6why, one step back
1from jinja2 import Environment
23print Environment(extensions=['jinja2.i18n.TransExtension']).from_string("""\4{% trans %}Hello {{ user }}!{% endtrans %}5{% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}6""").render(user="someone")