Django

Code

Ticket #4281 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Error in the documentation example

Reported by: Indy Assigned to: jacob
Milestone: Component: Documentation
Version: SVN Keywords: blocktrans, count
Cc: Triage Stage: Ready for checkin
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

The following i18n documentation example doesn't work, because there is no count filter by default:

{% blocktrans count list|count as counter %}
There is only one {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktrans %}

The correct version:

{% blocktrans count list|length as counter %}
There is only one {{ name }} object.
{% plural %}
There are {{ counter }} {{ name }} objects.
{% endblocktrans %}

Attachments

Change History

05/12/07 10:35:37 changed by Gary Wilson <gary.wilson@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

05/12/07 10:38:25 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [5207]) Fixed #4281 -- Fixed error in docs/i18n.txt example


Add/Change #4281 (Error in the documentation example)




Change Properties
Action