From 1053ad1b025720432e53305d1b49c3493ce8616e Mon Sep 17 00:00:00 2001 From: wasneet <3689701918@qq.com> Date: Mon, 21 Apr 2025 21:50:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E7=9D=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UPDATE.txt | 6 ++++++ translate/import.py | 14 +++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/UPDATE.txt b/UPDATE.txt index fa010df..c8cfc49 100644 --- a/UPDATE.txt +++ b/UPDATE.txt @@ -4,4 +4,10 @@ 主要修改:現在可以依照語言導入對應貼圖了。 因此同時修改了images的目錄。 +——Wasneet Potato + +2025/4/21 星期一 更新 + +進一步修改了「import.py」腳本 + ——Wasneet Potato \ No newline at end of file diff --git a/translate/import.py b/translate/import.py index 1fde05a..1775963 100644 --- a/translate/import.py +++ b/translate/import.py @@ -4,14 +4,18 @@ from tempfile import TemporaryDirectory import subprocess import shutil import os +import datetime from tools import convert_zh_to_tw, import_translation_json - # ========== 配置区域 ========== -IMPORTLANG = "zh_TW" # 語言選項 -VERSION = "V1.1" # 版本號 -WEBLATE_PATH = "F:/Deskto/psoutertale-weblate" # WEBLATE文件夾路徑(須修改!) -SOURCE_DIR = Path("F:/Deskto/Petrichor-PSTVL").resolve() # Petrichor倉庫的根目錄(須修改!) +IMPORTLANG = input("语言?(跳过则语言默认为zh_CN)") # 語言選項 +if len(IMPORTLANG) == 0: + IMPORTLANG = "zh_CN" +VERSION = "v" + input("版本号?(跳过则记录构建日期)") # 版本號 +if len(VERSION) == 1: + VERSION = "构建于" + str(datetime.date.today()) +WEBLATE_PATH = os.path.abspath("../psoutertale-weblate") +SOURCE_DIR = Path("../Petrichor-PSTVL").resolve() # ============================== # WTGIIIR協定