Django documentation states:
The caveat with using variables or computed values, as in the previous two examples, is that Django\'s translation-stri
I ended up solving it with a similar solution suggested in @StFS answer.
When I used pgettext('forecast type', 'some string')
, then using {% trans varName %}
in my template still returns "some string" instead of "New Text" for the translation.
So I have changed the syntax in the function to gettext('some string')
.
Now using {% trans varName %}
would give "New Text" in my template.