summaryrefslogtreecommitdiff
path: root/django/utils/translation/trans_null.py
diff options
context:
space:
mode:
authorBouke Haarsma <bouke@webatoom.nl>2013-11-12 07:54:01 +0100
committerClaude Paroz <claude@2xlibre.net>2014-02-26 16:58:04 +0100
commit2bab9d6d9ea095c4bcaeede2df576708afd46291 (patch)
tree8225995e22d76818f9659ceff5629a30d4a38d2d /django/utils/translation/trans_null.py
parent48a8b714d49d7a4ceee66473aea72c2d8c84a672 (diff)
Fixed #21389 -- Accept most valid language codes
By removing the 'supported' keyword from the detection methods and only relying on a cached settings.LANGUAGES, the speed of said methods has been improved; around 4x raw performance. This allows us to stop checking Python's incomplete list of locales, and rely on a less restrictive regular expression for accepting certain locales. HTTP Accept-Language is defined as being case-insensitive, based on this fact extra performance improvements have been made; it wouldn't make sense to check for case differences.
Diffstat (limited to 'django/utils/translation/trans_null.py')
-rw-r--r--django/utils/translation/trans_null.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/translation/trans_null.py b/django/utils/translation/trans_null.py
index 69f32bc243..75dedda5f7 100644
--- a/django/utils/translation/trans_null.py
+++ b/django/utils/translation/trans_null.py
@@ -68,5 +68,5 @@ def get_language_from_request(request, check_path=False):
return settings.LANGUAGE_CODE
-def get_language_from_path(request, supported=None):
+def get_language_from_path(request):
return None