#34221: Plural-Forms in .po files break Django's translation precedence. ------------------------------------------------+------------------------ Reporter: Stefano Parmesan | Owner: nobody Type: Bug | Status: new Component: Internationalization | Version: 4.1 Severity: Normal | Keywords: i18n Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | ------------------------------------------------+------------------------ According to the [https://docs.djangoproject.com/en/4.1/topics/i18n/translation/#how- django-discovers-translations| documentation], Django reads translations from `LOCALE_PATHS` first, then from apps in `INSTALLED_APPS`, and then from its own folders.
This behaviour breaks if the files in `LOCALE_PATHS` contain `Plural- Forms` while those found in `INSTALLED_APPS` don't. To test this behaviour I created a test project on github here: https://github.com/armisael/test-django-i18n-preference The project contains a .po file with `Plural-Forms` and a single translation that is also included in one of the dependencies. A single test checks which translation is picked. With the current configuration, the test fails by using the dependency translation. It passes if: 1) the dependency is removed from `INSTALLED_APPS`; or if 2) `Plural-Forms` is removed from the .po file. 1) proves that i18n is correctly configured, and that the dependency translation is picked over the project one; 2) proves that `Plural-Forms` is involved in the bug. -- Ticket URL: <https://code.djangoproject.com/ticket/34221> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018533cafaed-9a3640f5-8781-46f0-8c78-ad6232a94561-000000%40eu-central-1.amazonses.com.