mirror of
https://github.com/Newnetirc/Bitbot-Modified-Modules.git
synced 2026-01-24 06:50:18 +00:00
Update translate.py
fixed language codes with - in it eg. zh-cn
This commit is contained in:
committed by
GitHub
parent
ce1d33fe6b
commit
9b78a22653
@@ -6,8 +6,8 @@ from src import ModuleManager, utils
|
|||||||
|
|
||||||
URL_TRANSLATE = "http://translate.googleapis.com/translate_a/single"
|
URL_TRANSLATE = "http://translate.googleapis.com/translate_a/single"
|
||||||
URL_LANGUAGES = "https://cloud.google.com/translate/docs/languages"
|
URL_LANGUAGES = "https://cloud.google.com/translate/docs/languages"
|
||||||
REGEX_LANGUAGES = re.compile(r"^(\w+)?:(\w+)?\s+", re.I)
|
REGEX_LANGUAGES = re.compile(r"^([\w-]+)?\:([\w-]+)?\s+", re.I)
|
||||||
REGEX_TARGET = re.compile(r"^([a-z]{2,5})\s+", re.I)
|
REGEX_TARGET = re.compile(r"^([\w-]{2,8})\s+", re.I)
|
||||||
|
|
||||||
|
|
||||||
class Module(ModuleManager.BaseModule):
|
class Module(ModuleManager.BaseModule):
|
||||||
|
|||||||
Reference in New Issue
Block a user