Opened 9 years ago

Closed 9 years ago

#26295 closed New feature (fixed)

LocaleMiddleware.is_language_prefix_patterns_used should be cached per urlconf.

Reported by: Simon Charette Owned by: nobody
Component: Core (URLs) 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 actual behavior prevents i18n_patterns from being used by a urlconf different from the one defined by ROOT_URLCONF.

The request.urlconf attribute should be taken into account when determining whether or not i18n_patterns is used.

For example, if you were use django-hosts to map hostnames to different set of urlconfs you couldn't have some using i18n_patterns and some not.

I looked at docs.djangoproject.com urlconf and figured out i18n_patterns might not have been used for this exact reason.

Change History (4)

comment:1 by Tim Graham, 9 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted
Type: BugNew feature

PR

I guess this might be more of a new feature rather than a bug since the documentation currently says i18n_patterns can only be used in ROOT_URLCONF.

comment:2 by Simon Charette, 9 years ago

Patch needs improvement: unset

comment:3 by Claude Paroz, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Simon Charette <charette.s@…>, 9 years ago

Resolution: fixed
Status: newclosed

In d0451e4c:

Fixed #26295 -- Allowed using i18n_patterns() in any root URLconf.

Thanks Tim for the review.

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