Django

Code

Changeset 1241

Show
Ignore:
Timestamp:
11/15/05 07:51:31 (3 years ago)
Author:
hugo
Message:

added missing docstring to the blocktrans template tag

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/templatetags/i18n.py

    r1230 r1241  
    164164def do_block_translate(parser, token): 
    165165    """ 
     166    This will translate a block of text with parameters. 
     167 
     168    Format is like this:: 
     169 
     170        {% blocktrans with foo|filter as bar and baz|filter as boo %} 
     171        This is {{ bar }} and {{ boo }}. 
     172        {% endblocktrans %} 
     173 
     174    Additionally this supports pluralization:: 
     175 
     176        {% blocktrans count var|length as count %} 
     177        There is {{ count }} object. 
     178        {% plural %} 
     179        There are {{ count }} objects. 
     180        {% endblocktrans %} 
     181 
     182    This is much like ngettext, only in template syntax. 
    166183    """ 
    167184    class BlockTranslateParser(TokenParser):