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 fileTake it
moved example code aroundArmin Ronacherbefore adoption612b3a8
lines 1–6why, one step back1from jinja2 import Environment23print 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")