mirror of
https://github.com/searxng/searxng.git
synced 2025-08-02 10:02:20 +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
|
@ -810,6 +810,9 @@ def search():
|
|||
)
|
||||
)
|
||||
|
||||
# search_query.lang contains the user choice (all, auto, en, ...)
|
||||
# when the user choice is "auto", search.search_query.lang contains the detected language
|
||||
# otherwise it is equals to search_query.lang
|
||||
return render(
|
||||
# fmt: off
|
||||
'results.html',
|
||||
|
@ -834,6 +837,11 @@ def search():
|
|||
settings['search']['languages'],
|
||||
fallback=request.preferences.get_value("language")
|
||||
),
|
||||
search_language = match_language(
|
||||
search.search_query.lang,
|
||||
settings['search']['languages'],
|
||||
fallback=request.preferences.get_value("language")
|
||||
),
|
||||
timeout_limit = request.form.get('timeout_limit', None)
|
||||
# fmt: on
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue