0
votes

I have a third-party application installed which has translation tags in its templates and also provides translations for those in several languages, but I'd like to change a few translations for only one language.

I ran the makemessages command and the msgid's for those third-party application show up nicely in my own .po file in the folder I use as LOCALE_PATHS. Then, I added corresponding msgstr's for them, ran compilemessages and expected my translations to override the ones that were provided by the third-party application, but I still see the ones provided by the application even though other translations from my own .po/.mo files are correctly showing up.

This procedure does work for overriding translations in the Django admin interface (and I'm using the exact same .po file for this), so I'm not sure what should be done differently in this case. Is there some setting in the application that could prevent translations being overridden?

I tried everything up to restarting the webserver, rebuilding the Docker images that I'm using, etc. etc., but I only get to see my own translations once I remove the application's .mo file, which does indicate that my compilemessages worked as expected, i.e. adding my translations of the application to my own .mo file, but apparently Django is giving preference to the application's .mo file instead of mine, despite the Django docs stating that the language coming from my LOCALE_PATHS should have the highest precedence.

What am I missing here?

1

1 Answers

0
votes

In this case, it turned out that the django.po file supplied by the third-party application was missing a Plural-Forms line, whereas the django.po file trying to override the translations did have this line, which apparently made it impossible for Django to match them together.

After creating a branch of the third-party application in which I created the django.po/django.mo files with the Plural-Forms line, I was able to override the default translations without any problems.