添加百度翻译官方接口

This commit is contained in:
John Smith
2021-04-23 21:35:57 +08:00
parent 0b848b1288
commit df6097a184
3 changed files with 104 additions and 1 deletions

View File

@@ -109,6 +109,11 @@ class AppConfig:
translator_config['secret_id'] = section['secret_id']
translator_config['secret_key'] = section['secret_key']
translator_config['region'] = section['region']
elif type_ == 'BaiduTranslate':
translator_config['source_language'] = section['source_language']
translator_config['target_language'] = section['target_language']
translator_config['app_id'] = section['app_id']
translator_config['secret'] = section['secret']
else:
raise ValueError(f'Invalid translator type: {type_}')