mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
[1.3.X] Fixes #16072 -- incorrect documentation for multiple expressions inside a blocktrans tag
Backport of r16268 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b9bdc96f9e
commit
18ecfad767
@ -490,13 +490,15 @@ for use within the translation block. Examples::
|
|||||||
This will have {{ myvar }} inside.
|
This will have {{ myvar }} inside.
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
|
||||||
If you need to bind more than one expression inside a ``blocktrans`` tag,
|
You can use multiple expressions inside a single ``blocktrans`` tag::
|
||||||
separate the pieces with ``and``::
|
|
||||||
|
|
||||||
{% blocktrans with book_t=book|title and author_t=author|title %}
|
{% blocktrans with book_t=book|title and author_t=author|title %}
|
||||||
This is {{ book_t }} by {{ author_t }}
|
This is {{ book_t }} by {{ author_t }}
|
||||||
{% endblocktrans %}
|
{% endblocktrans %}
|
||||||
|
|
||||||
|
.. note:: The previous more verbose format is still supported:
|
||||||
|
``{% blocktrans with book|title as book_t and author|title as author_t %}``
|
||||||
|
|
||||||
This tag also provides for pluralization. To use it:
|
This tag also provides for pluralization. To use it:
|
||||||
|
|
||||||
* Designate and bind a counter value with the name ``count``. This value will
|
* Designate and bind a counter value with the name ``count``. This value will
|
||||||
@ -528,9 +530,6 @@ construct is internally converted to an ``ungettext`` call. This means the
|
|||||||
same :ref:`notes regarding ungettext variables <pluralization-var-notes>`
|
same :ref:`notes regarding ungettext variables <pluralization-var-notes>`
|
||||||
apply.
|
apply.
|
||||||
|
|
||||||
.. note:: The previous more verbose format is still supported:
|
|
||||||
``{% blocktrans with book|title as book_t and author|title as author_t %}``
|
|
||||||
|
|
||||||
Reverse URL lookups cannot be carried out within the ``blocktrans`` and should
|
Reverse URL lookups cannot be carried out within the ``blocktrans`` and should
|
||||||
be retrieved (and stored) beforehand::
|
be retrieved (and stored) beforehand::
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user