添加腾讯翻译官方接口

This commit is contained in:
John Smith
2021-04-11 22:11:13 +08:00
parent f6e38c8804
commit 8aa80fadd3
3 changed files with 185 additions and 13 deletions

View File

@@ -78,6 +78,16 @@ class AppConfig:
if type_ == 'TencentTranslateFree':
translator_config['source_language'] = section['source_language']
translator_config['target_language'] = section['target_language']
elif type_ == 'BilibiliTranslateFree':
pass
elif type_ == 'TencentTranslate':
translator_config['source_language'] = section['source_language']
translator_config['target_language'] = section['target_language']
translator_config['secret_id'] = section['secret_id']
translator_config['secret_key'] = section['secret_key']
translator_config['region'] = section['region']
else:
raise ValueError(f'Invalid translator type: {type_}')
translator_configs.append(translator_config)
self.translator_configs = translator_configs