Skip to content

The only downloader you need. 下载器的集大成者。

Fixes #445

XiaoYouChRa84aed3c672a
diff --git a/app/assets/i18n/gd3.zh_CN.qm b/app/assets/i18n/gd3.zh_CN.qm
new file mode 100644
index 00000000..8647e778
Binary files /dev/null and b/app/assets/i18n/gd3.zh_CN.qm differ
diff --git a/app/assets/resources.py b/app/assets/resources.py
index 3c3821aa..bae82c86 100644
--- a/app/assets/resources.py
+++ b/app/assets/resources.py
@@ -6,6 +6,10 @@
from PySide6 import QtCore
qt_resource_data = b"\
+\x00\x00\x00\x1a\
+<\
+\xb8d\x18\xca\xef\x9c\x95\xcd!\x1c\xbf`\xa1\xbd\xdd\xa7\
+\x00\x00\x00\x05zh_CN\
\x00\x00\xb6Q\
<\
\xb8d\x18\xca\xef\x9c\x95\xcd!\x1c\xbf`\xa1\xbd\xdd\xa7\
@@ -242080,6 +242084,10 @@ qt_resource_name = b"\
\x00i\
\x001\x008\x00n\
\x00\x0c\
+\x03\x9a\xd9}\
+\x00g\
+\x00d\x003\x00.\x00z\x00h\x00_\x00C\x00N\x00.\x00q\x00m\
+\x00\x0c\
\x01\xe4\xac\xdd\
\x00g\
\x00d\x003\x00.\x00e\x00n\x00_\x00U\x00S\x00.\x00q\x00m\
@@ -242128,32 +242136,34 @@ qt_resource_name = b"\
qt_resource_struct = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x0c\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x0d\
\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x05\x00\x00\x00\x07\
+\x00\x00\x00\x1c\x00\x02\x00\x00\x00\x06\x00\x00\x00\x07\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x0c\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\
\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x01\x10\x00\x00\x00\x00\x00\x01\x004\xd4\xbf\
-\x00\x00\x01\x9d\xf3\x09\x1c\xa2\
-\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x01\x00\x03\x11[\
-\x00\x00\x01\x9d\xf3\x09\x1c\xb0\
-\x00\x00\x00\xd6\x00\x00\x00\x00\x00\x01\x002Y\xf3\
-\x00\x00\x01\x9d\xf3\x09\x1c\xb2\
+\x00\x00\x01.\x00\x00\x00\x00\x00\x01\x004\xd4\xdd\
+\x00\x00\x01\x9e:\xb1N8\
+\x00\x00\x00\xde\x00\x00\x00\x00\x00\x01\x00\x03\x11y\
+\x00\x00\x01\x9e:\xb1NL\
+\x00\x00\x00\xf4\x00\x00\x00\x00\x00\x01\x002Z\x11\
+\x00\x00\x01\x9e:\xb1NO\
+\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x00\x1e\
+\x00\x00\x01\x9e:\xb1N&\
+\x00\x00\x00f\x00\x00\x00\x00\x00\x01\x00\x00\xb6s\
+\x00\x00\x01\x9e:\xb1N-\
\x00\x00\x00*\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-\x00\x00\x01\x9d\xf3\x09\x8cs\
-\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\xb6U\
-\x00\x00\x01\x9d\xf3\x09\x8d\xb7\
-\x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x01\xd2\xb3\
-\x00\x00\x01\x9d\xf3\x09\x8dL\
-\x00\x00\x00\xa2\x00\x00\x00\x00\x00\x01\x00\x02Z\xe1\
-\x00\x00\x01\x9d\xf3\x09\x8e\x22\
-\x00\x00\x00f\x00\x00\x00\x00\x00\x01\x00\x01>S\
-\x00\x00\x01\x9d\xf3\x09\x8c\xe0\
-\x00\x00\x01v\x00\x00\x00\x00\x00\x01\x0072\xd4\
-\x00\x00\x01\x9d\xf3\x09\x1c\x9a\
-\x00\x00\x01&\x00\x00\x00\x00\x00\x01\x006\x06\xf2\
-\x00\x00\x01\x9d\xf3\x09\x1c\x9f\
+\x00\x00\x01\x9e:\xd4G&\
+\x00\x00\x00\xa2\x00\x00\x00\x00\x00\x01\x00\x01\xd2\xd1\
+\x00\x00\x01\x9e:\xb1N/\
+\x00\x00\x00\xc0\x00\x00\x00\x00\x00\x01\x00\x02Z\xff\
+\x00\x00\x01\x9e:\xb1N*\
+\x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x01>q\
+\x00\x00\x01\x9e:\xb1N(\
+\x00\x00\x01\x94\x00\x00\x00\x00\x00\x01\x0072\xf2\
+\x00\x00\x01\x9e:\xb1N\x22\
+\x00\x00\x01D\x00\x00\x00\x00\x00\x01\x006\x07\x10\
+\x00\x00\x01\x9e:\xb1N1\
"
def qInitResources():
diff --git a/app/assets/resources.qrc b/app/assets/resources.qrc
index f0c80a27..4629b823 100644
--- a/app/assets/resources.qrc
+++ b/app/assets/resources.qrc
@@ -12,6 +12,7 @@
<!-- <file>received_info.wav</file>-->
</qresource>
<qresource prefix="i18n">
+ <file alias="gd3.zh_CN.qm">i18n/gd3.zh_CN.qm</file>
<file alias="gd3.en_US.qm">i18n/gd3.en_US.qm</file>
<file alias="gd3.ja_JP.qm">i18n/gd3.ja_JP.qm</file>
<file alias="gd3.zh_TW.qm">i18n/gd3.zh_TW.qm</file>
diff --git a/sync_i18n_res.py b/sync_i18n_res.py
index 0ce4f36f..774c712a 100644
--- a/sync_i18n_res.py
+++ b/sync_i18n_res.py
@@ -9,9 +9,7 @@ ROOT_DIR = Path(__file__).resolve().parent
I18N_DIR = ROOT_DIR / "app" / "assets" / "i18n"
RESOURCES_QRC = ROOT_DIR / "app" / "assets" / "resources.qrc"
RESOURCES_PY = ROOT_DIR / "app" / "assets" / "resources.py"
-SOURCE_LANGUAGE = "zh_CN"
-RUNTIME_LANGUAGES = ["en_US", "ja_JP", "zh_TW", "zh_HK", "ru_RU"]
-SYNC_LANGUAGES = [SOURCE_LANGUAGE, *RUNTIME_LANGUAGES]
+RUNTIME_LANGUAGES = ["zh_CN", "en_US", "ja_JP", "zh_TW", "zh_HK", "ru_RU"]
EXCLUDED_FILES = {
Path("app/assets/resources.py"),
}
@@ -59,15 +57,15 @@ def update_ts_files(py_files: list[str]) -> None:
lupdate = resolve_tool("pyside6-lupdate")
I18N_DIR.mkdir(parents=True, exist_ok=True)
- for language in SYNC_LANGUAGES:
- ts_path = I18N_DIR / f"gd3.{language}.ts"
+ for localeName in RUNTIME_LANGUAGES:
+ ts_path = I18N_DIR / f"gd3.{localeName}.ts"
run_command([
lupdate,
"-no-ui-lines",
"-source-language",
- SOURCE_LANGUAGE,
+ "zh_CN",
"-target-language",
- language,
+ localeName,
*py_files,
"-ts",
ts_path.as_posix(),
@@ -77,9 +75,9 @@ def update_ts_files(py_files: list[str]) -> None:
def build_qm_files() -> None:
lrelease = resolve_tool("pyside6-lrelease")
- for language in RUNTIME_LANGUAGES:
- ts_path = I18N_DIR / f"gd3.{language}.ts"
- qm_path = I18N_DIR / f"gd3.{language}.qm"
+ for localeName in RUNTIME_LANGUAGES:
+ ts_path = I18N_DIR / f"gd3.{localeName}.ts"
+ qm_path = I18N_DIR / f"gd3.{localeName}.qm"
run_command([
lrelease,
ts_path.as_posix(),