summaryrefslogtreecommitdiff
path: root/searx/query.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2022-12-16 20:28:57 +0000
committerAlexandre Flament <alex@al-f.net>2023-02-17 15:17:36 +0000
commit6748e8e2d5eff3c2202b2a714afb5534b1573101 (patch)
tree57f6fcf3d5b9bb5ee3b4a03aaf8aac2a53ee7106 /searx/query.py
parent54389a29feb3feea5a868f7b3b83c9718fb71014 (diff)
downloadsearxng-6748e8e2d5eff3c2202b2a714afb5534b1573101.tar.gz
searxng-6748e8e2d5eff3c2202b2a714afb5534b1573101.zip
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.
Diffstat (limited to 'searx/query.py')
-rw-r--r--searx/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/searx/query.py b/searx/query.py
index b8e1c1275..dbc52ec75 100644
--- a/searx/query.py
+++ b/searx/query.py
@@ -104,7 +104,7 @@ class LanguageParser(QueryPartParser):
break
# user may set a valid, yet not selectable language
- if VALID_LANGUAGE_CODE.match(value):
+ if VALID_LANGUAGE_CODE.match(value) or value == 'auto':
lang_parts = value.split('-')
if len(lang_parts) > 1:
value = lang_parts[0].lower() + '-' + lang_parts[1].upper()