From bd9cb4c9f45ab6b26359cacc2dc6a44ec58f21ff Mon Sep 17 00:00:00 2001 From: Georg Bauer Date: Sat, 1 Oct 2005 16:45:16 +0000 Subject: [PATCH] i18n: fixed a rather stupid bug in language discovery (sort descending by preference value instead ascending) git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@762 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/translation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/utils/translation.py b/django/utils/translation.py index 40246e311d..b776023466 100644 --- a/django/utils/translation.py +++ b/django/utils/translation.py @@ -200,7 +200,7 @@ def get_language_from_request(request): return (lang, order) langs = [_parsed(el) for el in accept.split(',')] - langs.sort(lambda a,b: cmp(a[1], b[1])) + langs.sort(lambda a,b: -1*cmp(a[1], b[1])) globalpath = os.path.join(os.path.dirname(settings.__file__), 'locale')