Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django trans tag within a default filter

Tags:

Does anyone know how this could properly be written in Django?

{{ mu.expiry_date|default:"{% trans 'Free User' %}"}} 

Obviously, the above does not work since it contains a tag within a tag's filter.

like image 839
Rok Avatar asked Aug 29 '10 14:08

Rok


1 Answers

Templates have an underscore syntax for translation also:

{{ mu.expiry_date|default:_("Free User")}} 
like image 91
Ned Batchelder Avatar answered Oct 14 '22 21:10

Ned Batchelder