forked from zaclys/searxng
6579d6d558
The request function should not request a language (aka locale) that is not supported by qwant. Select a locale like zh-TW ends in qwant's API error: ERROR searx.engines.qwant news: exception : \ API error::locale must be one of the following values: \ en_gb, en_ie, en_us, en_ca, en_my, en_au, en_nz, de_de, de_ch, de_at, fr_fr, \ fr_be, fr_ch, fr_ca, fr_ad, fc_ca, co_fr, es_es, es_ar, es_cl, es_co, es_mx, \ es_pe, es_ad, ca_es, ca_ad, ca_fr, eu_es, eu_fr, it_it, it_ch, pt_pt, pt_ad, \ nl_be, nl_nl The existing searx.utils.match_language function is unsuitable for this purpose, it is replaced by function searx.locales.get_engine_locale that is based on the methods from the babel package. The quant's _fetch_supported_languages function has been revised to filter out languages 8aka locales) not supported by qwant. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de> |
||
---|---|---|
.. | ||
answerers | ||
data | ||
engines | ||
infopage | ||
metrics | ||
network | ||
plugins | ||
search | ||
shared | ||
static | ||
templates/simple | ||
translations | ||
__init__.py | ||
autocomplete.py | ||
babel_extract.py | ||
compat.py | ||
exceptions.py | ||
external_bang.py | ||
external_urls.py | ||
flaskfix.py | ||
languages.py | ||
locales.py | ||
preferences.py | ||
query.py | ||
redislib.py | ||
results.py | ||
searxng.msg | ||
settings.yml | ||
settings_defaults.py | ||
settings_loader.py | ||
unixthreadname.py | ||
utils.py | ||
version.py | ||
webadapter.py | ||
webapp.py | ||
webutils.py |