This commit is contained in:
wailovet
2024-04-30 14:23:36 +08:00
parent 5a85c2f609
commit edce7694c7
+6 -4
View File
@@ -2,6 +2,9 @@
import os
import json
import folder_paths
from pathlib import Path
COMFY_PATH = Path(folder_paths.__file__).parent
ZH_Replace_Map = {
@@ -25,8 +28,8 @@ ZH_Replace_Map = {
def gen_translate(NODE_DISPLAY_NAME_MAPPINGS={}, NODE_CLASS_MAPPINGS={}):
translation_dir = os.path.join(os.path.dirname(
os.path.dirname(__file__)), "AIGODLIKE-COMFYUI-TRANSLATION", "zh-CN", "Nodes")
translation_dir = os.path.join(COMFY_PATH, "custom_nodes",
"AIGODLIKE-COMFYUI-TRANSLATION", "zh-CN", "Nodes")
translation_config = os.path.join(
translation_dir, "ComfyUI_MinusZone.translate.json")
@@ -84,6 +87,5 @@ def gen_translate(NODE_DISPLAY_NAME_MAPPINGS={}, NODE_CLASS_MAPPINGS={}):
with open(translation_config, "w", encoding="utf-8") as f:
f.write(json.dumps(nodes, indent=4, ensure_ascii=False))
else:
print("No translation dir found.")
print("No translation dir found.")