Revert "remove 'all' option from search languages"

This reverts commit 4d1770398a.
This commit is contained in:
Noémi Ványi 2019-01-06 15:27:46 +01:00
parent 491792c1a5
commit b63d645a52
51 changed files with 245 additions and 70 deletions

View file

@ -68,7 +68,10 @@ def response(resp):
html = fromstring(resp.text)
search_results = html.xpath(wikidata_ids_xpath)
language = match_language(resp.search_params['language'], supported_languages, language_aliases).split('-')[0]
if resp.search_params['language'].split('-')[0] == 'all':
language = 'en'
else:
language = match_language(resp.search_params['language'], supported_languages, language_aliases).split('-')[0]
# TODO: make requests asynchronous to avoid timeout when result_count > 1
for search_result in search_results[:result_count]: