Detecting non-translation wrapped strings in Django?

15 views Asked by At

I have a Django project being maintained by multiple developers. It needs to support i18n, so all model field names, help text, labels in custom templates, etc need to get wrapped by gettext_lazy.

Occasionally, however, a developer will forget to wrap a new string, which leads to regressions where text does not get translated in the UI.

Is there an existing tool I can run to scan Django's templates and models and report non-translation wrapped strings so I can add a check to my build to catch these regressions?

I guess it would be the inverse of django-admin makemessages, which finds all strings wrapped by gettext_lazy, but I can't find anything like this in Django's docs.

0

There are 0 answers