Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#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 David, 6 years ago

Owner: changed from nobody to David
Status: newassigned

comment:2 by David, 6 years ago

Has patch: set
Last edited 6 years ago by Tim Graham (previous) (diff)

comment:3 by Claude Paroz, 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 David, 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 Claude Paroz, 6 years ago

Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

comment:6 by Carlton Gibson, 6 years ago

Triage Stage: AcceptedReady 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:7 by Carlton Gibson <carlton.gibson@…>, 6 years ago

Resolution: fixed
Status: assignedclosed

In 5db8d617:

Fixed #29713 -- Added check that LANGUAGE_CODE uses standard language id format.

comment:8 by Nick Pope, 6 years ago

Follow up PR

comment:9 by Carlton Gibson <carlton.gibson@…>, 6 years ago

In 570402f:

Refs #29713 -- Improved error message from translation system check.

comment:10 by Nick Pope, 6 years ago

See #30241 for a follow up to add additional checks for language-related settings.

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

In d478304:

Refs #29713 -- Improved error message when LANGUAGE_CODE is invalid.

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