From 4186f3d136b60f5949770768e5542d219dc10754 Mon Sep 17 00:00:00 2001
From: Nriver <6752679+Nriver@users.noreply.github.com>
Date: Tue, 15 Oct 2024 15:46:34 +0800
Subject: [PATCH] add translation for app_context.js
---
src/public/app/components/app_context.js | 8 ++++----
src/public/translations/cn/translation.json | 3 +++
src/public/translations/en/translation.json | 3 +++
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/public/app/components/app_context.js b/src/public/app/components/app_context.js
index 04c11e8b7..6e571d50a 100644
--- a/src/public/app/components/app_context.js
+++ b/src/public/app/components/app_context.js
@@ -13,7 +13,7 @@ import MobileScreenSwitcherExecutor from "./mobile_screen_switcher.js";
import MainTreeExecutors from "./main_tree_executors.js";
import toast from "../services/toast.js";
import ShortcutComponent from "./shortcut_component.js";
-import { initLocale } from "../services/i18n.js";
+import { t, initLocale } from "../services/i18n.js";
class AppContext extends Component {
constructor(isMainWindow) {
@@ -33,11 +33,11 @@ class AppContext extends Component {
await initLocale();
}
- setLayout(layout) {
+ setLayout(layout) {
this.layout = layout;
}
- async start() {
+ async start() {
this.initComponents();
this.renderWidgets();
@@ -151,7 +151,7 @@ $(window).on('beforeunload', () => {
if (!component.beforeUnloadEvent()) {
console.log(`Component ${component.componentId} is not finished saving its state.`);
- toast.showMessage("Please wait for a couple of seconds for the save to finish, then you can try again.", 10000);
+ toast.showMessage(t("app_context.please_wait_for_save"), 10000);
allSaved = false;
}
diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json
index 1c379700e..ecad19c86 100644
--- a/src/public/translations/cn/translation.json
+++ b/src/public/translations/cn/translation.json
@@ -1421,5 +1421,8 @@
"file_last_modified": "文件 最后修改时间为 。",
"upload_modified_file": "上传修改的文件",
"ignore_this_change": "忽略此更改"
+ },
+ "app_context": {
+ "please_wait_for_save": "请等待几秒钟以完成保存,然后您可以尝试再操作一次。"
}
}
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index e8a61e464..4255a1f5d 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -1421,5 +1421,8 @@
"file_last_modified": "File has been last modified on .",
"upload_modified_file": "Upload modified file",
"ignore_this_change": "Ignore this change"
+ },
+ "app_context": {
+ "please_wait_for_save": "Please wait for a couple of seconds for the save to finish, then you can try again."
}
}