Allow translate source/target languages to be more than 2 chars

This commit is contained in:
jesopo 2018-07-14 09:06:52 +01:00
parent d12b61620d
commit 7d9f3dc6e4

View file

@ -3,7 +3,7 @@ import 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("(\w{2})?:(\w{2})? ") REGEX_LANGUAGES = re.compile("(\w+)?:(\w+)? ")
class Module(object): class Module(object):
def __init__(self, bot): def __init__(self, bot):