summaryrefslogtreecommitdiff
path: root/examples/basic/translate.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic/translate.py')
-rw-r--r--examples/basic/translate.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/basic/translate.py b/examples/basic/translate.py
index 1fb8ee6..8d1970f 100644
--- a/examples/basic/translate.py
+++ b/examples/basic/translate.py
@@ -1,3 +1,4 @@
+from __future__ import print_function
from jinja2 import Environment
env = Environment(extensions=['jinja2.ext.i18n'])
@@ -8,7 +9,7 @@ env.globals['ngettext'] = lambda s, p, n: {
'%(count)s user': '%(count)d Benutzer',
'%(count)s users': '%(count)d Benutzer'
}[n == 1 and s or p]
-print env.from_string("""\
+print(env.from_string("""\
{% trans %}Hello {{ user }}!{% endtrans %}
{% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}
-""").render(user="someone", users=[1, 2, 3])
+""").render(user="someone", users=[1, 2, 3]))