mirror of https://github.com/django/django.git
added missing docstring to the blocktrans template tag
git-svn-id: http://code.djangoproject.com/svn/django/trunk@1241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ed92d36825
commit
705a568854
|
@ -163,6 +163,23 @@ def do_translate(parser, token):
|
||||||
|
|
||||||
def do_block_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):
|
class BlockTranslateParser(TokenParser):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue