From 2bab9d6d9ea095c4bcaeede2df576708afd46291 Mon Sep 17 00:00:00 2001 From: Bouke Haarsma Date: Tue, 12 Nov 2013 07:54:01 +0100 Subject: 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. --- docs/releases/1.7.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs') diff --git a/docs/releases/1.7.txt b/docs/releases/1.7.txt index 4d12a58e72..aef8842e36 100644 --- a/docs/releases/1.7.txt +++ b/docs/releases/1.7.txt @@ -1125,6 +1125,14 @@ Miscellaneous For example, if you use multi-inheritance, you need to define custom primary key fields on parent models, otherwise the default ``id`` fields will clash. +* :meth:`~django.utils.translation.parse_accept_lang_header` now returns + lowercase locales, instead of the case as it was provided. As locales should + be treated case-insensitive this allows us to speed up locale detection. + +* :meth:`~django.utils.translation.get_language_from_path` and + :meth:`~django.utils.translation.trans_real.get_supported_language_variant` + now no longer have a ``supported`` argument. + .. _deprecated-features-1.7: Features deprecated in 1.7 -- cgit v1.3