[fix] check language aliases when setting search language

This commit is contained in:
Marc Abonce Seguin 2018-11-25 23:32:48 -06:00
parent 3c95d64ff8
commit 5568f24d6c
16 changed files with 29 additions and 11 deletions

View file

@ -68,7 +68,7 @@ def response(resp):
html = fromstring(resp.text)
search_results = html.xpath(wikidata_ids_xpath)
language = match_language(resp.search_params['language'], supported_languages).split('-')[0]
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]: