Update translate.py

fixed language codes with - in it  eg.   zh-cn
This commit is contained in:
deepend-tildeclub 2025-07-10 13:42:29 -06:00 committed by GitHub
parent ce1d33fe6b
commit 9b78a22653
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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):