Fixed #2347 -- documented the use of "and" in the blocktrans template tag.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2006-07-14 02:57:10 +00:00
parent dba1f95e12
commit 50448de634
1 changed files with 11 additions and 4 deletions

View File

@ -224,6 +224,13 @@ block::
This will have {{ myvar }} inside.
{% endblocktrans %}
If you need to bind more than one expression inside a ``blocktrans`` tag,
separate the pieces with ``and``::
{% blocktrans with book|title as book_t and author|title as author_t %}
This is {{ book_t }} by {{ author_t }}
{% endblocktrans %}
To pluralize, specify both the singular and plural forms with the
``{% plural %}`` tag, which appears within ``{% blocktrans %}`` and
``{% endblocktrans %}``. Example::
@ -306,7 +313,7 @@ marked for translation. It creates (or updates) a message file in the directory
``conf/locale``. In the ``de`` example, the file will be
``conf/locale/de/LC_MESSAGES/django.po``.
If run over your project source tree or your appliation source tree, it will
If run over your project source tree or your application source tree, it will
do the same, but the location of the locale directory is ``locale/LANG/LC_MESSAGES``
(note the missing ``conf`` prefix).
@ -647,7 +654,7 @@ The ``javascript_catalog`` view
-------------------------------
The main solution to these problems is the ``javascript_catalog`` view, which
sends out a JavaScript code library with functions that mimick the ``gettext``
sends out a JavaScript code library with functions that mimic the ``gettext``
interface, plus an array of translation strings. Those translation strings are
taken from the application, project or Django core, according to what you
specify in either the {{{info_dict}}} or the URL.