#14126: blocktrans count is parsing incorrectly -------------------------------+-------------------------------------------- Reporter: mark0978 | Owner: nobody Status: new | Milestone: Component: Translations | Version: 1.2 Keywords: blocktrans plural | Stage: Unreviewed Has_patch: 0 | -------------------------------+-------------------------------------------- Context looks like: {'docs_needed': 2, ... (from the stack trace provided)
{{{ {% blocktrans count docs_needed as counter %} }}} Generates this error: Caught !KeyError while rendering: u'docs_needed' {{{ {% blocktrans count docs_needed|default:2 as counter %} }}} Generates this error: Caught !KeyError while rendering: u'docs_needed' {{{ {% blocktrans count docs_needed|length as counter %} }}} Does not give a !KeyError, but produces the wrong result since the length of docs_needed is 1 since it is scalar? The template contains: {{{ {% blocktrans count docs_needed|length as counter %} <h3>Waiting on the following document:</h3> {% plural %} <h3>Waiting on the following {{ counter }} documents:</h3> {% endblocktrans %} }}} and the output produced looks like: {{{ <h3>Waiting on the following documents:</h3> }}} The documentation @ http://docs.djangoproject.com/en/dev/topics/i18n/internationalization /#blocktrans-template-tag makes it look like a scalar is needed after the word key word '''count''' because it uses '''list|length''' as an example, which appears to be a filter creating a scalar value. I'm using Django 1.2.1 (not a version you can pick below) -- Ticket URL: <http://code.djangoproject.com/ticket/14126> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.