~metalune/simplytranslate-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH web] Add ICIBA as a translation engine

Details
Message ID
<20211016210825.39953-1-austinhuang@disroot.org>
DKIM signature
pass
Download raw message
Patch: +10 -0
From: Austin Huang <austinhuang@disroot.org>

---
 config.conf          | 4 ++++
 main.py              | 4 ++++
 templates/index.html | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/config.conf b/config.conf
index 237d8fd..3f2cac2 100644
--- a/config.conf
+++ b/config.conf
@@ -14,3 +14,7 @@ ApiKey = [REDACTED]
[google]
# Google translate is enabled by default.
Enabled = True

[iciba]
# ICIBA Translate (a.k.a. PowerWord) is disabled by default.
Enabled = False
diff --git a/main.py b/main.py
index 03d3235..9b6f069 100644
--- a/main.py
+++ b/main.py
@@ -14,6 +14,7 @@ from io import BytesIO

from simplytranslate_engines.googletranslate import GoogleTranslateEngine
from simplytranslate_engines.libretranslate import LibreTranslateEngine
from simplytranslate_engines.icibatranslate import IcibaTranslateEngine
from simplytranslate_engines.utils import *

import requests
@@ -43,6 +44,9 @@ if libretranslate_enabled:
        )
    )

if config.getboolean("iciba", "Enabled", fallback=False):
    engines.append(IcibaTranslateEngine())

if not engines:
    raise Exception("All translation engines are disabled")

diff --git a/templates/index.html b/templates/index.html
index 2d173b4..cd7ad90 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -149,6 +149,8 @@
                                Google
                            {%- elif _engine == "libre" -%}
                                LibreTranslate
                            {%- elif _engine == "iciba" -%}
                                ICIBA
                            {%- else -%}
                                {{ _engine }}
                            {%- endif -%}
-- 
2.33.0
Details
Message ID
<CFFEMZB5IVVO.1LG7D7VN9EUDN@thonkpad>
In-Reply-To
<20211016210825.39953-1-austinhuang@disroot.org> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
This patch doesn't apply with the current version of the
simplytranslate_web repository, please fix (it's probably just something
to do with the fact that I added some lines in the config.conf to add
deepl support)
Reply to thread Export thread (mbox)