#30241 closed Cleanup/optimization (fixed)
Add system checks to ensure correct configuration of translation settings.
| Reported by: | Nick Pope | Owned by: | Nick Pope |
|---|---|---|---|
| Component: | Core (System checks) | Version: | dev |
| Severity: | Normal | Keywords: | translations, system checks, language tags |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
Following on from #29713 which added translation.E001 to check LANGUAGE_CODE, I proposed the following:;
translation.E002:'You have provided an invalid language code in the LANGUAGES setting: {}.'translation.E003:'You have provided an invalid language code in the LANGUAGES_BIDI setting: {}.'translation.E004:'You have provided a value for the LANGUAGE_CODE setting that is not in the LANGUAGES setting.'translation.W005:'You have provided values in the LANGUAGES_BIDI setting that are not in the LANGUAGES setting.'
Note W005 instead of E005 - this case can simply be a warning because it will not cause things to go wrong, but highlights a potential configuration issue.
Change History (7)
comment:1 by , 7 years ago
| Description: | modified (diff) |
|---|---|
| Has patch: | set |
| Patch needs improvement: | set |
comment:2 by , 7 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 7 years ago
| Patch needs improvement: | unset |
|---|
comment:4 by , 7 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
comment:6 by , 7 years ago
It seems that when overriding LANGUAGES it's required to override LANGUAGES_BIDI too. This might not be intentional...?
Example failure: https://travis-ci.org/matthiask/feincms3-sites/jobs/517232818 respectively
Destroying test database for alias 'default' ('test_feincms3_sites')...
SystemCheckError: System check identified some issues:
ERRORS:
?: (translation.E005) You have provided values in the LANGUAGES_BIDI setting that are not in the LANGUAGES setting.
System check identified 1 issue (0 silenced).
The command "cd tests && ./manage.py test -v 2 testapp && cd .." exited with 1.
This is with LANGUAGES = (("en", "English"), ("de", "German")) and LANGUAGES_BIDI from django/conf/global_settings.py (meaning not provided respectively unchanged)
PR