]> git.ipfire.org Git - ipfire.org.git/blobdiff - www/webapp/handlers_base.py
Add new download load balancer.
[ipfire.org.git] / www / webapp / handlers_base.py
index 602b9fef49317d5a4728b613895174a91c80aba5..15d795ca24ab6cd26c12aea27a58989cf9de81c1 100644 (file)
@@ -21,9 +21,11 @@ class BaseHandler(tornado.web.RequestHandler):
                # another output that guessed.
                locale = self.get_argument("locale", None)
                if locale:
-                       locale = tornado.locale.get(locale)
-                       for locale in ALLOWED_LOCALES:
-                               return locale
+                       for l in ALLOWED_LOCALES:
+                               if not l.code.startswith(locale):
+                                       continue
+
+                               return l
 
                # If no locale was provided we guess what the browser sends us
                locale = self.get_browser_locale()