From 705a568854a56840e0cf064f110559f6ef10a9c1 Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Tue, 15 Nov 2005 13:51:31 +0000 Subject: [PATCH] added missing docstring to the blocktrans template tag git-svn-id: http://code.djangoproject.com/svn/django/trunk@1241 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/templatetags/i18n.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/django/templatetags/i18n.py b/django/templatetags/i18n.py index 8873586c24..bf752ed598 100644 --- a/django/templatetags/i18n.py +++ b/django/templatetags/i18n.py @@ -163,6 +163,23 @@ def do_translate(parser, token): def do_block_translate(parser, token): """ + This will translate a block of text with parameters. + + Format is like this:: + + {% blocktrans with foo|filter as bar and baz|filter as boo %} + This is {{ bar }} and {{ boo }}. + {% endblocktrans %} + + Additionally this supports pluralization:: + + {% blocktrans count var|length as count %} + There is {{ count }} object. + {% plural %} + There are {{ count }} objects. + {% endblocktrans %} + + This is much like ngettext, only in template syntax. """ class BlockTranslateParser(TokenParser):