I am trying to start localizing the Django language in a project, but makemessages always ignores the html templates in my templates folder.
I run python manage.py makemessages -a from the project root, and all lines marked for translation inside .py files anywhere in the project are successfully added to the .po file.
Any of the lines in the html templates, i.e. {{ trans "String_to_translate" }} , is ignored and is not added to the .po file, even if the necessary module is loaded at the top of the template, {% load i18n %} .
To test the possibility of excluding the entire template folder from the makemessages function, I created a .py file and included a line for translation there and was successfully added to the .po file.
With all this, does anyone know what might cause this problem? Thanks in advance for your help!
EDIT: The solution consists solely of changing the syntax {{ trans "string" }} to {% trans "string" %}
dlmccoy
source share