1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00

[fix] broken language selector

This commit is contained in:
marc 2016-12-13 21:36:40 -06:00
parent 93233c786a
commit 1b46ecd21a

View File

@ -211,10 +211,14 @@ def get_search_query_from_webapp(preferences, form):
# set query # set query
query = raw_text_query.getSearchQuery() query = raw_text_query.getSearchQuery()
# get last selected language in query, if possible # set specific language if set on request, query or preferences
# TODO support search with multible languages # TODO support search with multible languages
if len(raw_text_query.languages): if len(raw_text_query.languages):
query_lang = raw_text_query.languages[-1] query_lang = raw_text_query.languages[-1]
elif 'language' in form:
query_lang = form.get('language')
else:
query_lang = preferences.get_value('language')
query_time_range = form.get('time_range') query_time_range = form.get('time_range')