Opened 6 years ago

Closed 6 years ago

#30342 closed Bug (fixed)

Remove the LANGUAGES_BIDI<=LANGUAGES check.

Reported by: Matthias Kestenholz Owned by: Matthias Kestenholz
Component: Core (System checks) Version: dev
Severity: Release blocker Keywords:
Cc: pope1ni Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

(Adding Nick Pope to Cc: as author of the commit referenced below)

Since https://github.com/django/django/commit/4400d8296d268f5a8523cd02ddc33b12219b2535 there is a system check which verifies that LANGUAGES_BIDI is a subset of LANGUAGES. This breaks almost all installations of Django using a custom LANGUAGES list which do not also override LANGUAGES_BIDI -- probably many installations.

All of them will either have to add a LANGUAGES_BIDI override or silence translation.E005 when updating. If this is intentional then this change has to be mentioned in the release notes and documented somewhere.

However, I don't really see the need to verify that LANGUAGES_BIDI is a subset of LANGUAGES and propose that the easiest and also the best way to solve this is to remove the translation.E005 check again.

Here's a test which currently fails but shouldn't in my opinion:

diff --git a/tests/check_framework/test_translation.py b/tests/check_framework/test_translation.py
index 9a34b65c06..cea844988d 100644
--- a/tests/check_framework/test_translation.py
+++ b/tests/check_framework/test_translation.py
@@ -92,3 +92,7 @@ class TranslationCheckTests(SimpleTestCase):
             self.assertEqual(check_language_settings_consistent(None), [
                 Error(msg, id='translation.E005'),
             ])
+
+    def test_languages_without_bidi(self):
+        with self.settings(LANGUAGE_CODE='en', LANGUAGES=[('en', 'English')]):
+            self.assertEqual(check_language_settings_consistent(None), [])

Change History (5)

comment:1 by Mariusz Felisiak, 6 years ago

Resolution: wontfix
Status: newclosed

Thanks for the report, however there is not a valid use case for using LANGUAGES_BIDI that are not in LANGUAGES, that's why we added this check. I don't think that it is a big issue to override LANGUAGES_BIDI (when you override LANGUAGES) or silence this checks. We do not put system checks into release notes normally, IMO it's necessary.

comment:2 by Claude Paroz, 6 years ago

Resolution: wontfix
Severity: NormalRelease blocker
Status: closednew
Triage Stage: UnreviewedAccepted

Reopening, based on the django-developers discussion. I also think that backwards compatibility has priority over the check framework, so a solution has to be found.

comment:3 by Matthias Kestenholz, 6 years ago

PR

The pull request removes the system check and amends the LANGUAGES_BIDI description to make it clear that LANGUAGES_BIDI isn't supposed to be a subset of LANGUAGES.

comment:4 by Mariusz Felisiak, 6 years ago

Has patch: set
Owner: changed from nobody to Matthias Kestenholz
Status: newassigned
Summary: Remove the LANGUAGES_BIDI<=LANGUAGES checkRemove the LANGUAGES_BIDI<=LANGUAGES check.

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 80482e92:

Fixes #30342 -- Removed a system check for LANGUAGES_BIDI setting.

This partly reverts commit 4400d8296d268f5a8523cd02ddc33b12219b2535.

Note: See TracTickets for help on using tickets.
Back to Top