changeset 4221:f37c12f53bf2

Fixed: use werkzeugs accept_languages header property
author Florian Krupicka <florian.krupicka@googlemail.com>
date Tue, 15 Jul 2008 12:32:01 +0200
parents 39b7dd8d0747
children f77469d98cd2
files MoinMoin/i18n/__init__.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Tue Jul 15 11:18:04 2008 +0200
+++ b/MoinMoin/i18n/__init__.py	Tue Jul 15 12:32:01 2008 +0200
@@ -358,15 +358,12 @@
     the request, normalizing to lower case.
     """
     fallback = []
-    accepted = request.http_accept_language
+    accepted = request.accept_languages
     if accepted:
-        # Extract the languages names from the string
-        accepted = accepted.split(',')
-        accepted = [lang.split(';')[0] for lang in accepted]
         # Add base language for each sub language. If the user specified
         # a sub language like "en-us", we will try to to provide it or
         # a least the base language "en" in this case.
-        for lang in accepted:
+        for lang, quality in accepted:
             lang = lang.lower()
             fallback.append(lang)
             if '-' in lang: