summaryrefslogtreecommitdiff
path: root/searx/autocomplete.py
diff options
context:
space:
mode:
authormarc <a01200356@itesm.mx>2016-08-05 23:34:56 -0500
committermarc <a01200356@itesm.mx>2016-12-13 19:32:00 -0600
commit149802c56926bf48520c98932c4c36b8152b3d2d (patch)
treef450a584a785c31a1c118be29b3039f779a0cb70 /searx/autocomplete.py
parente58949b76fac7aa93341523ff0e2f35e0a03e057 (diff)
downloadsearxng-149802c56926bf48520c98932c4c36b8152b3d2d.tar.gz
searxng-149802c56926bf48520c98932c4c36b8152b3d2d.zip
[enh] add supported_languages on engines and auto-generate languages.py
Diffstat (limited to 'searx/autocomplete.py')
-rw-r--r--searx/autocomplete.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/autocomplete.py b/searx/autocomplete.py
index 527104041..dff8a69a0 100644
--- a/searx/autocomplete.py
+++ b/searx/autocomplete.py
@@ -81,17 +81,17 @@ def searx_bang(full_query):
engine_query = full_query.getSearchQuery()[1:]
for lc in language_codes:
- lang_id, lang_name, country = map(str.lower, lc)
+ lang_id, lang_name, country, english_name = map(str.lower, lc)
# check if query starts with language-id
if lang_id.startswith(engine_query):
if len(engine_query) <= 2:
- results.append(':{lang_id}'.format(lang_id=lang_id.split('_')[0]))
+ results.append(':{lang_id}'.format(lang_id=lang_id.split('-')[0]))
else:
results.append(':{lang_id}'.format(lang_id=lang_id))
# check if query starts with language name
- if lang_name.startswith(engine_query):
+ if lang_name.startswith(engine_query) or english_name.startswith(engine_query):
results.append(':{lang_name}'.format(lang_name=lang_name))
# check if query starts with country