From 9b78a2265303c5c3099a38aeea8d55405abc0f25 Mon Sep 17 00:00:00 2001 From: deepend-tildeclub <58404188+deepend-tildeclub@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:42:29 -0600 Subject: [PATCH] Update translate.py fixed language codes with - in it eg. zh-cn --- translate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate.py b/translate.py index 2d16ccc..5bda70b 100644 --- a/translate.py +++ b/translate.py @@ -6,8 +6,8 @@ from src import ModuleManager, utils URL_TRANSLATE = "http://translate.googleapis.com/translate_a/single" URL_LANGUAGES = "https://cloud.google.com/translate/docs/languages" -REGEX_LANGUAGES = re.compile(r"^(\w+)?:(\w+)?\s+", re.I) -REGEX_TARGET = re.compile(r"^([a-z]{2,5})\s+", re.I) +REGEX_LANGUAGES = re.compile(r"^([\w-]+)?\:([\w-]+)?\s+", re.I) +REGEX_TARGET = re.compile(r"^([\w-]{2,8})\s+", re.I) class Module(ModuleManager.BaseModule):