Browse Source

[fix] is_valid_lang fixed for new languages.py + dictzone engine encoding

potato 7 years ago
parent
commit
9b82cb1908
2 changed files with 3 additions and 3 deletions
  1. 1
    1
      searx/engines/dictzone.py
  2. 2
    2
      searx/utils.py

+ 1
- 1
searx/engines/dictzone.py View File

37
 
37
 
38
     params['url'] = url.format(from_lang=from_lang[2],
38
     params['url'] = url.format(from_lang=from_lang[2],
39
                                to_lang=to_lang[2],
39
                                to_lang=to_lang[2],
40
-                               query=query)
40
+                               query=query.decode('utf-8'))
41
 
41
 
42
     return params
42
     return params
43
 
43
 

+ 2
- 2
searx/utils.py View File

295
     if is_abbr:
295
     if is_abbr:
296
         for l in language_codes:
296
         for l in language_codes:
297
             if l[0][:2] == lang.lower():
297
             if l[0][:2] == lang.lower():
298
-                return (True, l[0][:2], l[1].lower())
298
+                return (True, l[0][:2], l[3].lower())
299
         return False
299
         return False
300
     else:
300
     else:
301
         for l in language_codes:
301
         for l in language_codes:
302
             if l[1].lower() == lang.lower():
302
             if l[1].lower() == lang.lower():
303
-                return (True, l[0][:2], l[1].lower())
303
+                return (True, l[0][:2], l[3].lower())
304
         return False
304
         return False
305
 
305
 
306
 
306