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

Function read_file_to_memory

utils/userscript_localization_tool.py:41–51  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

39
40# 读取文件并查找中文简介
41def read_file_to_memory(file_path):
42 search_results = search_in_file(file_path, "zh-CN")
43 lines = []
44 chinese_texts = []
45 for name_match in search_results.name_matches:
46 lines.append(name_match)
47 chinese_texts.append((len(lines) - 1, name_match))
48 for description_match in search_results.description_matches:
49 lines.append(description_match)
50 chinese_texts.append((len(lines) - 1, description_match))
51 return chinese_texts
52
53
54# 用于保存翻译结果的线程函数

Callers 1

translate_localizedFunction · 0.70

Calls 1

search_in_fileFunction · 0.90

Tested by

no test coverage detected