1. Luke Plant
  2. django

Commits

hu...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 17a2d1c

added missing docstring to the blocktrans template tag

  • Participants
  • Parent commits 9f6765b
  • Branches default

Comments (0)

Files changed (1)

File django/templatetags/i18n.py

View file
 
 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):