MCPcopy
hub / github.com/ChinaGodMan/UserScripts / translate_localized

Function translate_localized

utils/userscript_localization_tool.py:95–105  ·  view source on GitHub ↗
(file_path, target_langs)

Source from the content-addressed store, hash-verified

93
94
95def translate_localized(file_path, target_langs):
96 chinese_texts = read_file_to_memory(file_path)
97 file_lock = threading.Lock()
98 max_threads = 5
99 with ThreadPoolExecutor(max_threads) as executor:
100 futures = [
101 executor.submit(translate_task, file_path, lang, chinese_texts, file_lock)
102 for lang in target_langs
103 ]
104 for future in futures:
105 future.result()
106
107
108def main():

Callers 1

mainFunction · 0.85

Calls 1

read_file_to_memoryFunction · 0.70

Tested by

no test coverage detected