MCPcopy Create free account
hub / github.com/ChinaGodMan/UserScripts / translate_worker

Function translate_worker

utils/userscript_localization_tool.py:55–60  ·  view source on GitHub ↗
(chinese_texts, translations, lang)

Source from the content-addressed store, hash-verified

53
54# 用于保存翻译结果的线程函数
55def translate_worker(chinese_texts, translations, lang):
56 for idx, chinese_text in chinese_texts:
57 translated_text = translate_text(chinese_text, lang)
58 if translated_text:
59 with translation_lock:
60 translations[(idx, chinese_text)] = translated_text
61
62
63# 翻译并返回翻译结果

Callers

nothing calls this directly

Calls 1

translate_textFunction · 0.90

Tested by

no test coverage detected