Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added missing docstring to the blocktrans template tag

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 705a568854a56840e0cf064f110559f6ef10a9c1 1 parent ed92d36
Georg Bauer authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 django/templatetags/i18n.py
View
17 django/templatetags/i18n.py
@@ -163,6 +163,23 @@ def top(self):
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):
Please sign in to comment.
Something went wrong with that request. Please try again.