'Django i18n using a translation from django.contrib module instead of LOCALE_PATHS file

My Django 3.2.9 project displays a translation of both _('Active') and {% translate 'Active' %} that comes from one of Django's modules instead of my application registration. However, other translations from registrations are properly used. By temporarily moving the locale directory outside of the application directory, I confirmed that not only LOCALE_PATHS is correctly set, but also used. Reordering my INSTALLED_APPS also does not change anything. Django seems to insist to use a translation from one of its modules instead from the one in LOCALE_PATHS.

The translation in the file looks standard:

#: .\registration\templates\users.html:109
#: .\registration\templates\list.html:34 .\registration\views.py:687
msgid "Active"
msgstr "XXX"

My settings look as follows:

BASE_DIR = Path(__file__).resolve().parent.parent

LOCALE_PATHS = [
    BASE_DIR / 'registration' / 'locale',
    BASE_DIR / 'administration' / 'locale',
]

I confirmed that the path is correct and contains django.po and django.mo in LC_MESSAGES under the language's code directory. As noted above, other translations work correctly.

Why does Django use its own version, even though mine is in LOCALE_PATHS and, after changing settings, at the front of INSTALLED_APPS? How can I ensure that Django uses my version?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source