diff --git a/.gitignore b/.gitignore index 87c3a5b..6c26e1d 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ backend/* backend/loquendoBot_backend.exe src/config/twitch-emotes.json dist/* +src/config/betterttv-emotes.json diff --git a/backend/loquendoBot_backend.py b/backend/loquendoBot_backend.py index 58d624b..ba3c48b 100644 --- a/backend/loquendoBot_backend.py +++ b/backend/loquendoBot_backend.py @@ -236,11 +236,14 @@ def get_translation(): request_data = request.json message = request_data.get("message", "") detectedLanguage = request_data.get("language", "") - translated = MyMemoryTranslator( - source=detectedLanguage, target=settings["LANGUAGE"]["TRANSLATE_TO"] - ).translate(message) + try: + translated = MyMemoryTranslator( + source=detectedLanguage, target=settings["LANGUAGE"]["TRANSLATE_TO"] + ).translate(message) + except Exception as e: + return jsonify({"error": str(e), "code":429 }), 429 except Exception as e: - return jsonify({"error": "Could not translate, continuing with next language"}), 500 + return jsonify({"error": str(e), "code":500 }), 500 return jsonify({"translation": translated}), 200 diff --git a/src/css/chat.css b/src/css/chat.css index da133b0..9685b95 100644 --- a/src/css/chat.css +++ b/src/css/chat.css @@ -541,6 +541,10 @@ h1 { margin: 20px 0px 0px 0px; } +.translation-message.user { + margin: -20px 0px 0px 0px; +} + .translation-icon { position: relative; padding: 0px 0px 0px 0px; @@ -558,3 +562,14 @@ h1 { height: 20px !important; left: 18px; } + +.flag-icon.user { + left: -18px; + top: -15px; +} + +.user-flag { + left: unset; + right: 18px; + top: -65px; +} diff --git a/src/index.html b/src/index.html index c9c820e..ef27d1c 100644 --- a/src/index.html +++ b/src/index.html @@ -294,6 +294,16 @@ tip="All translated messages will be send to primary TTS voice but if message is detected in Secondary TTS language it will output it to the Secondary TTS voice" > +