diff options
author | marc <a01200356@itesm.mx> | 2017-02-24 20:21:48 -0600 |
---|---|---|
committer | Adam Tauber <asciimoo@gmail.com> | 2017-03-18 23:44:21 +0100 |
commit | 805fb02ed1fb7f8e006c8def7d76a0d1958364bf (patch) | |
tree | 530b3b98842965c2343ee5e9568853acc7fd064a /utils | |
parent | e4d46d21c7ed2793edf446c4292971a853ed0e3d (diff) | |
download | searxng-805fb02ed1fb7f8e006c8def7d76a0d1958364bf.tar.gz searxng-805fb02ed1fb7f8e006c8def7d76a0d1958364bf.zip |
add language support for qwant
closes issue #863
Diffstat (limited to 'utils')
-rw-r--r-- | utils/fetch_languages.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/fetch_languages.py b/utils/fetch_languages.py index 5632c90ba..3241370c0 100644 --- a/utils/fetch_languages.py +++ b/utils/fetch_languages.py @@ -14,7 +14,8 @@ from json import loads, dumps import io from sys import path path.append('../searx') # noqa -from searx.engines import engines +from searx import settings +from searx.engines import initialize_engines, engines # Geonames API for country names. geonames_user = '' # ADD USER NAME HERE @@ -77,6 +78,7 @@ def get_country_name(locale): # Fetchs supported languages for each engine and writes json file with those. def fetch_supported_languages(): + initialize_engines(settings['engines']) for engine_name in engines: if hasattr(engines[engine_name], 'fetch_supported_languages'): try: @@ -117,7 +119,7 @@ def join_language_lists(): languages[lang]['counter'].append(engine_name) # filter list to include only languages supported by most engines - min_supported_engines = int(0.75 * len(engines_languages)) + min_supported_engines = int(0.70 * len(engines_languages)) languages = {code: lang for code, lang in languages.iteritems() if len(lang.get('counter', [])) >= min_supported_engines or |