Yes, I checked, it's iCIBA with a lowercase initial i.
Also formatted the file using `black`.
---
main.py | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/main.py b/main.py
index f1922e4..854e595 100755
--- a/main.py+++ b/main.py
@@ -6,6 +6,8 @@ from urllib.parse import urlencode
from simplytranslate_engines.libretranslate import LibreTranslateEngine
from simplytranslate_engines.googletranslate import GoogleTranslateEngine
+from simplytranslate_engines.icibatranslate import IcibaTranslateEngine+from simplytranslate_engines.deepl import DeeplEnginefrom simplytranslate_engines.utils import to_lang_code
############################
@@ -19,7 +21,7 @@ parser.add_argument("text", metavar="TEXT", nargs="+", help="The text to transla
parser.add_argument(
"-e",
"--engine",
- choices=("google", "libre"),+ choices=("google", "libre", "iciba", "deepl"), default="google",
help="Translation engine to use",
)
@@ -37,7 +39,14 @@ parser.add_argument(
parser.add_argument("-f", "--from", default="auto", help="Language to translate from")
parser.add_argument("-t", "--to", default="en", help="Language to translate to")
-parser.add_argument("-p", "--print", default=False, type=bool, action=argparse.BooleanOptionalAction, help="Toggle wether or not to print a shareable link, only works if --online is provided.")+parser.add_argument(+ "-p",+ "--print",+ default=False,+ type=bool,+ action=argparse.BooleanOptionalAction,+ help="Toggle wether or not to print a shareable link, only works if --online is provided.",+)parser.add_argument(
"-d",
@@ -140,6 +149,16 @@ else:
parser.error("You can't set instance for Google Translate")
engine = GoogleTranslateEngine()
+ elif engine_name == "iciba":+ if instance is not None:+ parser.error("You can't set instance for iCIBA")++ engine = IcibaTranslateEngine()+ elif engine_name == "deepl":+ if instance is not None:+ parser.error("You can't set instance for DeepL")++ engine = DeeplEngine() from_language = to_lang_code(from_language, engine)
to_language = to_lang_code(to_language, engine)
@@ -162,4 +181,3 @@ else:
if online and print_link:
print(link)
-
--
2.34.1