KeyError raised in template rendering when the number of placeholders differs between singular and plural
Here is a simple example to reproduce the bug:
template file: index.html
{% load i18n %}
{% blocktrans with myextra_field as extra_field and myamount as amount count myyears as years %}
That will cost $ {{ amount }} per year. {{ extra_field }}
{% plural %}
That will cost $ {{ amount }} per {{ years }} years.
{% endblocktrans %}
views.py:
from django.http import HttpResponse
from django.template import Context, loader
from django.http import HttpResponse
def index(request):
t = loader.get_template('index.html')
c = Context({
'myamount' : 10,
'myyears' : 1,
'myextra_field' : 2,
})
return HttpResponse(t.render(c))
Owner: |
changed from nobody to deltoide
|
milestone: |
→ 1.3
|
Triage Stage: |
Unreviewed → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Fix + regression test