mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #11915: generic Accept-Language matches country-specific variants
This commit is contained in:
@@ -6,6 +6,7 @@ from django.core.urlresolvers import (is_valid_path, get_resolver,
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.cache import patch_vary_headers
|
||||
from django.utils import translation
|
||||
from django.utils.datastructures import SortedDict
|
||||
|
||||
|
||||
class LocaleMiddleware(object):
|
||||
@@ -18,7 +19,7 @@ class LocaleMiddleware(object):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self._supported_languages = dict(settings.LANGUAGES)
|
||||
self._supported_languages = SortedDict(settings.LANGUAGES)
|
||||
self._is_language_prefix_patterns_used = False
|
||||
for url_pattern in get_resolver(None).url_patterns:
|
||||
if isinstance(url_pattern, LocaleRegexURLResolver):
|
||||
|
||||
Reference in New Issue
Block a user