mirror of
https://github.com/searxng/searxng.git
synced 2025-08-30 15:10:48 +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
|
@ -154,7 +154,7 @@ class SearchLanguageSetting(EnumStringSetting):
|
|||
"""Available choices may change, so user's value may not be in choices anymore"""
|
||||
|
||||
def _validate_selection(self, selection):
|
||||
if selection != '' and not VALID_LANGUAGE_CODE.match(selection):
|
||||
if selection != '' and selection != 'auto' and not VALID_LANGUAGE_CODE.match(selection):
|
||||
raise ValidationException('Invalid language code: "{0}"'.format(selection))
|
||||
|
||||
def parse(self, data: str):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue