I18N looks for translations in the reverse order of the apps
|Reported by:||Klaas van Schelven||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I18N should look for translation strings in the order of apps as given in INSTALLED_APPS. Translations in apps that appear earlier in that list should be used rather than translations later in that list in case there are conflicts.
As described in #14910 as "point 2". I'm reproducing the important parts here:
Django's default template loader is documented here:
Having looked at the original tests the most desirable order appears to be:
- Project path locale
- Apps (in correct order)
- Django's own translations
The attached patch is a reflection of
- The order mentioned above
- Non-destructive dictionary updates
- I had to move the monkey-patching code into the _merge function, because the first actually found locale is no longer known in advance.