From 8f3fc3c8ca578eff30bfc07f7dcbace1a26e5c47 Mon Sep 17 00:00:00 2001 From: ws3917 Date: Thu, 17 Apr 2025 20:27:41 +0800 Subject: [PATCH] 1313 --- translation-script.py | 64 +++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/translation-script.py b/translation-script.py index 60a48b443..66741dfa5 100644 --- a/translation-script.py +++ b/translation-script.py @@ -228,39 +228,39 @@ if __name__ == "__main__": "controls", ] - # initialize_translation_json( - # "text/en_US", - # translation_key_mtext, - # "strings/mtext.json", - # ) - # initialize_translation_json( - # "text/en_US", ["Text", "Array"], "strings/dialogue.json" - # ) - # os.system(f"cd {WEBLATE_PATH} && git pull") - # update_translation_json( - # f"{WEBLATE_PATH}/drhps/dialogue/en.json", - # "strings/dialogue.json", - # f"{WEBLATE_PATH}/drhps/dialogue/zh_CN.json", - # "strings/dialogue-zh_CN.json", - # ) - # update_translation_json( - # f"{WEBLATE_PATH}/drhps/mtext/en.json", - # "strings/mtext.json", - # f"{WEBLATE_PATH}/drhps/mtext/zh_CN.json", - # "strings/mtext-zh_CN.json", - # ) - # copy_dict_str = { - # "strings/dialogue.json": f"{WEBLATE_PATH}/drhps/dialogue/en.json", - # "strings/mtext.json": f"{WEBLATE_PATH}/drhps/mtext/en.json", - # "strings/dialogue-zh_CN.json": f"{WEBLATE_PATH}/drhps/dialogue/zh_CN.json", - # "strings/mtext-zh_CN.json": f"{WEBLATE_PATH}/drhps/mtext/zh_CN.json", - # } - # for src, dst in copy_dict_str.items(): - # os.system(f"cp -r {src} {dst}") + initialize_translation_json( + "text/en_US", + translation_key_mtext, + "strings/mtext.json", + ) + initialize_translation_json( + "text/en_US", ["Text", "Array"], "strings/dialogue.json" + ) + os.system(f"cd {WEBLATE_PATH} && git pull") + update_translation_json( + f"{WEBLATE_PATH}/drhps/dialogue/en.json", + "strings/dialogue.json", + f"{WEBLATE_PATH}/drhps/dialogue/zh_CN.json", + "strings/dialogue-zh_CN.json", + ) + update_translation_json( + f"{WEBLATE_PATH}/drhps/mtext/en.json", + "strings/mtext.json", + f"{WEBLATE_PATH}/drhps/mtext/zh_CN.json", + "strings/mtext-zh_CN.json", + ) + copy_dict_str = { + "strings/dialogue.json": f"{WEBLATE_PATH}/drhps/dialogue/en.json", + "strings/mtext.json": f"{WEBLATE_PATH}/drhps/mtext/en.json", + "strings/dialogue-zh_CN.json": f"{WEBLATE_PATH}/drhps/dialogue/zh_CN.json", + "strings/mtext-zh_CN.json": f"{WEBLATE_PATH}/drhps/mtext/zh_CN.json", + } + for src, dst in copy_dict_str.items(): + os.system(f"cp -r {src} {dst}") - # os.system( - # f"cd {WEBLATE_PATH} && git add -A && git commit -m Update && git push origin main" - # ) + os.system( + f"cd {WEBLATE_PATH} && git add -A && git commit -m Update && git push origin main" + ) import_translation( "text/en_US", "text/zh_CN",