diff --git a/searx/webapp.py b/searx/webapp.py index 0c5ed4570..cfb552514 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -178,9 +178,12 @@ flask_babel.get_translations = _get_translations def _get_browser_language(request, lang_list): for lang in request.headers.get("Accept-Language", "en").split(","): + if ';' in lang: + lang = lang.split(';')[0] locale = match_language(lang, lang_list, fallback=None) if locale is not None: return locale + return settings['search']['default_lang'] or 'en' @babel.localeselector