From 0a4280a13787bd3e132b2b9c4c2f7b1816aa6906 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 25 Apr 2024 19:48:37 +0200 Subject: [PATCH] [refactor] translation engines: add translate category Co-authored-by: Markus Heiser --- searx/engines/deepl.py | 9 ++------- searx/engines/dictzone.py | 2 +- searx/engines/lingva.py | 2 +- searx/engines/mozhi.py | 2 +- searx/engines/translated.py | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/searx/engines/deepl.py b/searx/engines/deepl.py index 9e4fbe21e..ce2109138 100644 --- a/searx/engines/deepl.py +++ b/searx/engines/deepl.py @@ -13,7 +13,7 @@ about = { } engine_type = 'online_dictionary' -categories = ['general'] +categories = ['general', 'translate'] url = 'https://api-free.deepl.com/v2/translate' api_key = None @@ -51,11 +51,6 @@ def response(resp): infobox += "" - results.append( - { - 'infobox': 'Deepl', - 'content': infobox, - } - ) + results.append({'answer': infobox}) return results diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.py index a6e1ae289..4a9c4811e 100644 --- a/searx/engines/dictzone.py +++ b/searx/engines/dictzone.py @@ -18,7 +18,7 @@ about = { } engine_type = 'online_dictionary' -categories = ['general'] +categories = ['general', 'translate'] url = 'https://dictzone.com/{from_lang}-{to_lang}-dictionary/{query}' weight = 100 diff --git a/searx/engines/lingva.py b/searx/engines/lingva.py index dac574afa..bf35deed4 100644 --- a/searx/engines/lingva.py +++ b/searx/engines/lingva.py @@ -13,7 +13,7 @@ about = { } engine_type = 'online_dictionary' -categories = ['general'] +categories = ['general', 'translate'] url = "https://lingva.thedaviddelta.com" search_url = "{url}/api/v1/{from_lang}/{to_lang}/{query}" diff --git a/searx/engines/mozhi.py b/searx/engines/mozhi.py index f6fdee566..3858ca4ef 100644 --- a/searx/engines/mozhi.py +++ b/searx/engines/mozhi.py @@ -15,7 +15,7 @@ about = { } engine_type = 'online_dictionary' -categories = ['general'] +categories = ['general', 'translate'] base_url = "https://mozhi.aryak.me" mozhi_engine = "google" diff --git a/searx/engines/translated.py b/searx/engines/translated.py index 105a1d717..ea8c081dc 100644 --- a/searx/engines/translated.py +++ b/searx/engines/translated.py @@ -14,7 +14,7 @@ about = { } engine_type = 'online_dictionary' -categories = ['dictionaries'] +categories = ['general', 'translate'] url = 'https://api.mymemory.translated.net/get?q={query}&langpair={from_lang}|{to_lang}{key}' web_url = 'https://mymemory.translated.net/en/{from_lang}/{to_lang}/{query}' weight = 100