From 92c6e88ad3e5ba57bd6e2ba64d0c38e8fd72ea09 Mon Sep 17 00:00:00 2001 From: marc Date: Mon, 31 Oct 2016 23:52:08 -0600 Subject: [PATCH] small fixes --- AUTHORS.rst | 3 +-- searx/engines/mediawiki.py | 2 +- searx/languages.py | 2 -- tests/robot/test_basic.robot | 6 +++--- utils/update_languages.py | 2 ++ 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/AUTHORS.rst b/AUTHORS.rst index 0c224088f..39a70f655 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -43,7 +43,7 @@ generally made searx better: - Kang-min Liu - Kirill Isakov - Guilhem Bonnefille -- Marc Abonce Seguin +- Marc Abonce Seguin @a01200356 - @jibe-b - Christian Pietsch @pietsch - @Maxqia @@ -55,7 +55,6 @@ generally made searx better: - Ammar Najjar @ammarnajjar - @stepshal - François Revol @mmuman -- marc @a01200356 - Harry Wood @harry-wood - Thomas Renard @threnard - Pydo ``_ diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.py index b17cb38e4..ea607dd60 100644 --- a/searx/engines/mediawiki.py +++ b/searx/engines/mediawiki.py @@ -15,7 +15,7 @@ from json import loads from string import Formatter from urllib import urlencode, quote -from searx.engines.wikipedia import supported_engines +from searx.engines.wikipedia import supported_languages # engine dependent config categories = ['general'] diff --git a/searx/languages.py b/searx/languages.py index 6d41d809f..b07d296ee 100644 --- a/searx/languages.py +++ b/searx/languages.py @@ -176,9 +176,7 @@ language_codes = ( (u"sh", u"Srpskohrvatski / Српскохрватски", u"", u"Serbo-Croatian"), (u"si", u"සිංහල", u"", u"Sinhalese"), (u"sk-SK", u"Slovenčina", u"Slovenská republika", u"Slovak"), - (u"sl", u"Slovenščina", u"", u"Slovenian"), (u"sl-SI", u"Slovenščina", u"Slovenija", u"Slovenian"), - (u"sl-SL", u"Slovenščina", u"Sierra Leone", u"Slovenian"), (u"sn", u"Chishona", u"", u""), (u"so", u"Soomaali", u"", u""), (u"sq", u"Shqip", u"", u"Albanian"), diff --git a/tests/robot/test_basic.robot b/tests/robot/test_basic.robot index a466a095c..522d3dfde 100644 --- a/tests/robot/test_basic.robot +++ b/tests/robot/test_basic.robot @@ -101,11 +101,11 @@ Change search language Page Should Contain about Page Should Contain preferences Go To http://localhost:11111/preferences - List Selection Should Be language Automatic - Select From List language Turkish (Turkey) - tr_TR + List Selection Should Be language Default language + Select From List language Türkçe (Türkiye) - tr-TR Submit Preferences Go To http://localhost:11111/preferences - List Selection Should Be language Turkish (Turkey) - tr_TR + List Selection Should Be language Türkçe (Türkiye) - tr-TR Change autocomplete Page Should Contain about diff --git a/utils/update_languages.py b/utils/update_languages.py index 193c19278..cc3fa29cc 100644 --- a/utils/update_languages.py +++ b/utils/update_languages.py @@ -35,7 +35,9 @@ languages = {} # To filter out invalid codes and dialects. def valid_code(lang_code): # filter invalid codes + # sl-SL is technically not invalid, but still a mistake if lang_code[:2] == 'xx'\ + or lang_code == 'sl-SL'\ or lang_code == 'jw'\ or lang_code[-2:] == 'UK'\ or lang_code[-2:] == 'XA'\