添加可选的翻译功能

This commit is contained in:
PikachuLiker
2020-11-02 22:18:17 +08:00
parent c1039872b9
commit fb453763df
4 changed files with 34 additions and 2 deletions

12
core.py
View File

@@ -207,10 +207,20 @@ def get_data_from_json(file_number, filepath, conf: config.Config): # 从JSON
json_data['release'] = release
json_data['cover_small'] = cover_small
json_data['tag'] = tag
json_data['naming_rule'] = eval(conf.naming_rule())
json_data['location_rule'] = location_rule
json_data['year'] = year
json_data['actor_list'] = actor_list
if conf.is_transalte():
translate_values = conf.transalte_values().split(",")
for translate_value in translate_values:
json_data[translate_value] = translate(json_data[translate_value])
naming_rule=""
for i in conf.naming_rule().split("+"):
if i not in json_data:
naming_rule+=i.strip("'").strip('"')
else:
naming_rule+=json_data[i]
json_data['naming_rule'] = naming_rule
return json_data