summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2008-04-16 14:21:57 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2008-04-16 14:21:57 +0200
commit2e9396ba8f6cfa9007d29724c6a14d3905078bcf (patch)
treea46432224e023a6efb1437b128ef9eaaf6b648ff /examples
parentb9bed15d7b461c6cea569e10b20c41da73667d3b (diff)
downloadjinja2-2e9396ba8f6cfa9007d29724c6a14d3905078bcf.tar.gz
reimplemented {% trans %}
--HG-- branch : trunk
Diffstat (limited to 'examples')
-rw-r--r--examples/translate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/examples/translate.py b/examples/translate.py
new file mode 100644
index 0000000..8b38d02
--- /dev/null
+++ b/examples/translate.py
@@ -0,0 +1,6 @@
+from jinja2 import Environment
+
+print Environment().from_string("""\
+{% trans %}Hello {{ user }}!{% endtrans %}
+{% trans count=users|count %}{{ count }} user{% pluralize %}{{ count }} users{% endtrans %}
+""").render()