translate.py
This file
Path
examples/basic/translate.py
6 lines · 273 bytes · Python
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 0a2ac69 point at it.
switched back to explicit set for assignments. {% foo = 42 %} becomes {% set foo = 42 %} and {% foo.something() }} becomes {{ void(foo.something() }} with this commit.Armin Ronacherbefore adoption0a2ac69
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")