From 858db68d661c0fdf1448d5ae02d63206d0ba56a1 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:51:26 +0800 Subject: [PATCH 1/6] add translation for tab_row.js --- src/public/app/widgets/tab_row.js | 17 +++++++++-------- src/public/translations/cn/translation.json | 9 +++++++++ src/public/translations/en/translation.json | 9 +++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index e47a1ee33..395dd51d5 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import BasicWidget from "./basic_widget.js"; import contextMenu from "../menus/context_menu.js"; import utils from "../services/utils.js"; @@ -37,11 +38,11 @@ const TAB_TPL = `
- + `; -const NEW_TAB_BUTTON_TPL = `
最后修改时间为 。",
+ "upload_modified_file": "上传修改的文件",
+ "ignore_this_change": "忽略此更改"
}
}
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index 2e742374a..c72abb34d 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -1414,5 +1414,10 @@
"toc": {
"table_of_contents": "Table of Contents",
"options": "Options"
+ },
+ "watched_file_update_status": {
+ "file_last_modified": "File
has been last modified on .",
+ "upload_modified_file": "Upload modified file",
+ "ignore_this_change": "Ignore this change"
}
}
From 529502524d088142eb0a09153d1763c837dd2c5a Mon Sep 17 00:00:00 2001
From: Nriver <6752679+Nriver@users.noreply.github.com>
Date: Tue, 15 Oct 2024 15:24:01 +0800
Subject: [PATCH 5/6] add missing context menu translation
---
src/public/app/menus/tree_context_menu.js | 4 ++--
src/public/translations/cn/translation.json | 2 ++
src/public/translations/en/translation.json | 2 ++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/public/app/menus/tree_context_menu.js b/src/public/app/menus/tree_context_menu.js
index 684b31c99..caa572816 100644
--- a/src/public/app/menus/tree_context_menu.js
+++ b/src/public/app/menus/tree_context_menu.js
@@ -62,8 +62,8 @@ export default class TreeContextMenu {
{ title: "----" },
{ title: `${t("tree-context-menu.search-in-subtree")} `, command: "searchInSubtree", uiIcon: "bx bx-search",
enabled: notSearch && noSelectedNotes },
- isHoisted ? null : { title: 'Hoist note ', command: "toggleNoteHoisting", uiIcon: "bx bx-empty", enabled: noSelectedNotes && notSearch },
- !isHoisted || !isNotRoot ? null : { title: 'Unhoist note ', command: "toggleNoteHoisting", uiIcon: "bx bx-door-open" },
+ isHoisted ? null : { title: `${t("tree-context-menu.hoist-note")} `, command: "toggleNoteHoisting", uiIcon: "bx bx-empty", enabled: noSelectedNotes && notSearch },
+ !isHoisted || !isNotRoot ? null : { title: `${t("tree-context-menu.unhoist-note")} `, command: "toggleNoteHoisting", uiIcon: "bx bx-door-open" },
{ title: `${t("tree-context-menu.edit-branch-prefix")} `, command: "editBranchPrefix", uiIcon: "bx bx-empty",
enabled: isNotRoot && parentNotSearch && noSelectedNotes && notOptions },
{ title: t("tree-context-menu.advanced"), uiIcon: "bx bx-empty", enabled: true, items: [
diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json
index 75169ae33..1c379700e 100644
--- a/src/public/translations/cn/translation.json
+++ b/src/public/translations/cn/translation.json
@@ -1290,6 +1290,8 @@
"insert-child-note": "插入子笔记",
"delete": "删除",
"search-in-subtree": "在子树中搜索",
+ "hoist-note": "提升笔记",
+ "unhoist-note": "取消提升笔记",
"edit-branch-prefix": "编辑分支前缀",
"advanced": "高级",
"expand-subtree": "展开子树",
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index c72abb34d..e8a61e464 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -1290,6 +1290,8 @@
"insert-child-note": "Insert child note",
"delete": "Delete",
"search-in-subtree": "Search in subtree",
+ "hoist-note": "Hoist note",
+ "unhoist-note": "Unhoist note",
"edit-branch-prefix": "Edit branch prefix",
"advanced": "Advanced",
"expand-subtree": "Expand subtree",
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 6/6] 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."
}
}