summaryrefslogtreecommitdiff
path: root/searx/engines/qwant.py
diff options
context:
space:
mode:
authorMarc Abonce Seguin <marc-abonce@mailbox.org>2020-09-14 00:05:48 -0700
committerAlexandre Flament <alex@al-f.net>2020-09-22 11:37:44 +0200
commitea9d979cc33c875dbc3439f8ef7b7f1eec7bb0b4 (patch)
treed43d7582ad23beaff77aefece8d1a1056297df7c /searx/engines/qwant.py
parente0142d380e4cdde64356f06dd5c8e76655763369 (diff)
downloadsearxng-ea9d979cc33c875dbc3439f8ef7b7f1eec7bb0b4.tar.gz
searxng-ea9d979cc33c875dbc3439f8ef7b7f1eec7bb0b4.zip
add language names in qwant's fetch languages function
Diffstat (limited to 'searx/engines/qwant.py')
-rw-r--r--searx/engines/qwant.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/searx/engines/qwant.py b/searx/engines/qwant.py
index ac918b905..98460604c 100644
--- a/searx/engines/qwant.py
+++ b/searx/engines/qwant.py
@@ -124,11 +124,10 @@ def _fetch_supported_languages(resp):
regions_json = loads(response_text)
- supported_languages = []
+ supported_languages = {}
for lang in regions_json['languages'].values():
- if lang['code'] == 'nb':
- lang['code'] = 'no'
for country in lang['countries']:
- supported_languages.append(lang['code'] + '-' + country)
+ lang_code = "{lang}-{country}".format(lang=lang['code'], country=country)
+ supported_languages[lang_code] = {'name': lang['name']}
return supported_languages