Opened 10 years ago
Closed 10 years ago
#24292 closed Uncategorized (wontfix)
{% blocktrans with count n=something %} isn't accepted
Reported by: | Markus Bertheau | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | 1.7 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I find it confusing that you can do {% blocktrans with foo=bar %}
and {% blocktrans with foo=bar count n=baz %}
, but when you need only the counter variable, the with
has to go: {% blocktrans count n=baz %}
.
The documentation doesn't clearly state how with
and count
work. As I understand now after reading the code, they serve as a marker for the following kwargs, where with
accepts many kwargs, and count
accepts only one.
In my mental model, with
and count
are markers on a different level. I'd find this syntax more intuitive:
{% blocktrans with a=foo b=bar %} {% blocktrans with a=foo b=bar count n=baz %} {% blocktrans with count n=baz %} {% blocktrans with a=foo count n=baz b=bar %} {% blocktrans with count n=baz a=foo b=bar %}
In all cases n
is the only plural variable.
My understand is that a key value pair is always meant to follow
with
. I don't think your syntax change would result in simpler code, but please reopen the ticket if you have an implementation to share (or a specific documentation clarification; I didn't have much trouble understanding the current docs).