~metalune/simplytranslate-devel

web: Add Reverso as a translation engine v2 APPLIED

: 1
 Add Reverso as a translation engine

 2 files changed, 7 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~metalune/simplytranslate-devel/patches/27456/mbox | git am -3
Learn more about email & git

[PATCH web v2] Add Reverso as a translation engine Export this patch

From: Austin Huang <im@austinhuang.me>

---
 config.conf | 3 +++
 main.py     | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/config.conf b/config.conf
index 2cbbed7..7295530 100644
--- a/config.conf
+++ b/config.conf
@@ -22,6 +22,9 @@ Enabled = True
# ICIBA Translate (a.k.a. PowerWord) is disabled by default.
Enabled = False

[reverso]
Enabled = True

[network]
port = 5000
host = 0.0.0.0
diff --git a/main.py b/main.py
index 5ddab85..31583e7 100644
--- a/main.py
+++ b/main.py
@@ -16,6 +16,7 @@ from simplytranslate_engines.googletranslate import GoogleTranslateEngine
from simplytranslate_engines.libretranslate import LibreTranslateEngine
from simplytranslate_engines.deepl import DeeplEngine
from simplytranslate_engines.icibatranslate import IcibaTranslateEngine
from simplytranslate_engines.reverso import ReversoTranslateEngine
from simplytranslate_engines.utils import *

import requests
@@ -35,6 +36,9 @@ if config.getboolean("deepl", "Enabled", fallback=False):
if config.getboolean("iciba", "Enabled", fallback=False):
    engines.append(IcibaTranslateEngine())

if config.getboolean("reverso", "Enabled", fallback=False):
    engines.append(ReversoTranslateEngine())

libretranslate_enabled = config.getboolean("libre", "Enabled", fallback=None)

if libretranslate_enabled is None:
-- 
2.33.0