From 6748e8e2d5eff3c2202b2a714afb5534b1573101 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Fri, 16 Dec 2022 20:28:57 +0000 Subject: Add "Auto-detected" as a language. When the user choose "Auto-detected", the choice remains on the following queries. The detected language is displayed. For example "Auto-detected (en)": * the next query language is going to be auto detected * for the current query, the detected language is English. This replace the autodetect_search_language plugin. --- searx/webadapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/webadapter.py') diff --git a/searx/webadapter.py b/searx/webadapter.py index 00dead2a9..dbcf25058 100644 --- a/searx/webadapter.py +++ b/searx/webadapter.py @@ -63,7 +63,7 @@ def parse_lang(preferences: Preferences, form: Dict[str, str], raw_text_query: R query_lang = preferences.get_value('language') # check language - if not VALID_LANGUAGE_CODE.match(query_lang): + if not VALID_LANGUAGE_CODE.match(query_lang) and query_lang != 'auto': raise SearxParameterException('language', query_lang) return query_lang -- cgit v1.2.3