0

I am trying to run a web-app locally (forked from here ) . I am using the {% trans %} tag to mark strings to be translated.

The original piece of code was <h3> Personal data</h3>.

However , when I change it to <h3>{% trans "Personal data" %}</h3> , the "Personal data" does not get translated , even though the original text (from the forked repository) in the following line gets translated .

The following screenshot highlights the issue : enter image description here

When I make any changes to the text between <html> tags, it gets reflected in my local instance. But when I make changes to strings marked with {% trans %} , it does not get translated in my local instance (even though the rest of the original text gets translated) .

Note : Changes made to text without {% trans %} tag are getting reflected in my local instance. enter image description here

The app is run using docker-compose up

Why does the {% trans %} tag not work on new changes ?

extra123
  • 13
  • 4
  • You have to run `makemessages` and `compilemessages`. See [Django Docs](https://docs.djangoproject.com/en/dev/topics/i18n/translation/#message-files) – NKSM Feb 19 '21 at 21:29
  • @NKSM I ran `django-admin makemessages` and `django-admin compilemessages` . The changes are still not getting registered in the django.po file, and thus still not translating in the web app. – extra123 Feb 20 '21 at 10:19

0 Answers0