#29713 closed New feature (fixed)
Add a django check to ensure the LANGUAGE_CODE setting uses the standard language ID format
Reported by: | Ian Foote | Owned by: | David |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | |
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
The LANGUAGE_CODE
should be formatted like en-us
not en_US
. Add a check to detect this error.
Change History (11)
comment:1 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 6 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
If we check this, then we should respect the "specs" (https://en.wikipedia.org/wiki/IETF_language_tag#Syntax_of_language_tags).
comment:4 by , 6 years ago
Thanks for the feedback! I ended up using language_code_re
in utils.translations.trans_real.py
that I believe meets the specs.
comment:5 by , 6 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:6 by , 6 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I left the smallest of niggles on the PR but other than that it looks good to go. Thanks Ian, David, Claude.
comment:10 by , 6 years ago
See #30241 for a follow up to add additional checks for language-related settings.
PR