[Django]-Django Template: Use translation in default_if_none

9👍

You can store the translated string in a variable, like:

{% trans 'TRANSLATED STRING' as transl %}
{{ value|default_if_none:transl }}

It however might make sense to define a custom template filter [Django-doc] here.

Leave a comment