Skip to content

Commit 8ca39f3

Browse files
committed
refactor: add preload version fetching messages in multiple languages
1 parent 1abb102 commit 8ca39f3

File tree

4 files changed

+19
-3
lines changed

4 files changed

+19
-3
lines changed

resource/loading.html

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@
6666
};
6767

6868
window.addEventListener("fetching-bc-start", () => {
69-
addLog(electron.i18n("正在获得BC版本"));
69+
addLog(electron.i18n("Preload::FetchingBCVersion"));
7070
});
7171

7272
window.addEventListener("fetching-bc-done", (info) => {
7373
const [bcv] = info.detail;
74-
addLog(electron.i18n("BC版本: {version}").replace("{version}", bcv.version));
74+
addLog(electron.i18n("Preload::FetchingBCVersionResult").replace("{version}", bcv.version));
75+
});
76+
77+
window.addEventListener("fetching-bc-fb", (info) => {
78+
const [bcv] = info.detail;
79+
addLog(electron.i18n("Preload::FetchingBCVersionFallback").replace("{version}", bcv.version));
7580
});
7681

7782
window.addEventListener("error", (info) => {

src/i18n/CN.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ const translation: Record<TextTag, string> = {
7373
'<p>发现版本更新,点击确认立即开始缓存用户界面相关资源。</p><p style="font-style:italic;">备注:首次加载会消耗网络流量,提前加载可以避免游戏中的图片加载延迟。如果现在取消加载,之后也可以通过菜单启动加载。</p>',
7474
"Alert::Cache::RelocateConfirm":
7575
"<p>新缓存目录为空,旧缓存数据可以移动到新目录。<br>移动时会读写硬盘、且无法使用缓存,是否移动?</p><p>(取消则不移动,保留原缓存并在新缓存目录创建空缓存)</p>",
76+
77+
"Preload::FetchingBCVersion": "正在获取BondageClub版本信息...",
78+
"Preload::FetchingBCVersionResult": "BondageClub版本: {version}",
79+
"Preload::FetchingBCVersionFallback": "使用替代版本号: {version}",
7680
};
7781

7882
export default translation;

src/i18n/EN.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ const translation: Record<TextTag, string> = {
8282
'<p>Version update found, click confirm to start caching UI related resources immediately.</p><p style="font-style:italic;">Note: Initial loading will consume network traffic, preloading can avoid image loading delay in game. If you cancel loading now, you can also start loading via menu later.</p>',
8383
"Alert::Cache::RelocateConfirm":
8484
"<p>New cache directory is empty, old cache data can be moved to new directory.<br>Moving will read and write disk, and cache cannot be used, do you want to move?</p><p>(Cancel will not move, keep old cache and create empty cache in new directory)</p>",
85+
86+
"Preload::FetchingBCVersion": "Fetching BondageClub version information...",
87+
"Preload::FetchingBCVersionResult": "BondageClub Version: {version}",
88+
"Preload::FetchingBCVersionFallback": "Using calculated version: {version}",
8589
};
8690

8791
export default translation;

src/i18n/Typedef.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,7 @@ type TextTag =
6464
| "Alert::Cache::ClearConfirm"
6565
| "Alert::Cache::ClearConfirmTips"
6666
| "Alert::Cache::UpdateConfirm"
67-
| "Alert::Cache::RelocateConfirm";
67+
| "Alert::Cache::RelocateConfirm"
68+
| "Preload::FetchingBCVersion"
69+
| "Preload::FetchingBCVersionResult"
70+
| "Preload::FetchingBCVersionFallback";

0 commit comments

Comments
 (0)