mirror of
https://github.com/searxng/searxng
synced 2024-11-18 15:26:25 +00:00
fix after rebase
This commit is contained in:
parent
b63d645a52
commit
97351a2c72
@ -32,7 +32,7 @@ supported_languages_url = 'https://meta.wikimedia.org/wiki/List_of_Wikipedias'
|
|||||||
# set language in base_url
|
# set language in base_url
|
||||||
def url_lang(lang):
|
def url_lang(lang):
|
||||||
lang_pre = lang.split('-')[0]
|
lang_pre = lang.split('-')[0]
|
||||||
if lang_pre == 'all' or lang_pre not in supported_languages:
|
if lang_pre == 'all' or lang_pre not in supported_languages and lang_pre not in language_aliases:
|
||||||
return 'en'
|
return 'en'
|
||||||
return match_language(lang, supported_languages, language_aliases).split('-')[0]
|
return match_language(lang, supported_languages, language_aliases).split('-')[0]
|
||||||
|
|
||||||
|
@ -26,15 +26,12 @@ class TestWikipediaEngine(SearxTestCase):
|
|||||||
self.assertIn('Test_Query', params['url'])
|
self.assertIn('Test_Query', params['url'])
|
||||||
self.assertNotIn('test_query', params['url'])
|
self.assertNotIn('test_query', params['url'])
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
dicto['language'] = 'nb'
|
dicto['language'] = 'nb'
|
||||||
params = wikipedia.request(query, dicto)
|
params = wikipedia.request(query, dicto)
|
||||||
self.assertIn('no.wikipedia.org', params['url'])
|
self.assertIn('no.wikipedia.org', params['url'])
|
||||||
=======
|
|
||||||
dicto['language'] = 'all'
|
dicto['language'] = 'all'
|
||||||
params = wikipedia.request(query, dicto)
|
params = wikipedia.request(query, dicto)
|
||||||
self.assertIn('en', params['url'])
|
self.assertIn('en', params['url'])
|
||||||
>>>>>>> Revert "remove 'all' option from search languages"
|
|
||||||
|
|
||||||
dicto['language'] = 'xx'
|
dicto['language'] = 'xx'
|
||||||
params = wikipedia.request(query, dicto)
|
params = wikipedia.request(query, dicto)
|
||||||
|
Loading…
Reference in New Issue
Block a user