mirror of
https://github.com/searxng/searxng.git
synced 2025-08-31 23:46:49 +02:00
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.
This commit is contained in:
parent
54389a29fe
commit
6748e8e2d5
14 changed files with 143 additions and 115 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue