{% set a = "foo" %}
{% set b = "bar" %}
{% set d = [1, 2, 3] %}
{% set mydict = {} %}
{% for c in d %}
{% do mydict.update({a: b}) %}
{% endfor %}
{{ _("Hello!") }}
Deleting the entirely nonsense block before _("Hello") makes it able to extract Hello, but in its current state, no messages are extracted.
changed the title [-]Jinja Extraction Fails when {a: b} is present in a dictionary[/-][+]JInja extraction fails silently without error if there's an unrecognized do statement with {a:b} inside[/+]on Jul 8, 2025
Activity
akx commented on Jul 8, 2025
I think the actual issue is that you're using a {% do %} statement, which is implemented as a Jinja extension.
No extensions are loaded by default unless you tell the Jinja extractor to; as documented in the Jinja docs, you would need
to have the extension (and thus the do statement, and thus no parsing error from Jinja) loaded for extraction.
johnzhou721 commented on Jul 8, 2025
But I think we at least an error message, not just stay silent about it.
johnzhou721 commented on Jul 8, 2025
Something like "unknown statement do"