添加基于azure api的机器翻译

This commit is contained in:
PikachuLiker
2021-01-11 15:28:12 +08:00
parent cca6ed937e
commit e40623ce1a
3 changed files with 31 additions and 5 deletions

View File

@@ -240,6 +240,13 @@ def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON
key=conf.get_transalte_key(),
delay=conf.get_transalte_delay(),
)
elif conf.get_transalte_engine() == "azure":
json_data[translate_value] = translate(
json_data[translate_value],
target_language="zh-Hans",
engine=conf.get_transalte_engine(),
key=conf.get_transalte_key(),
)
else:
json_data[translate_value] = translate(json_data[translate_value])