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/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/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": "忽略此更改"
+ },
+ "app_context": {
+ "please_wait_for_save": "请等待几秒钟以完成保存,然后您可以尝试再操作一次。"
}
}
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index 965f0d2f5..4255a1f5d 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",
@@ -1401,5 +1403,26 @@
},
"sql_table_schemas": {
"tables": "Tables"
+ },
+ "tab_row": {
+ "close_tab": "Close tab",
+ "add_new_tab": "Add new tab",
+ "close": "Close",
+ "close_other_tabs": "Close other tabs",
+ "close_all_tabs": "Close all tabs",
+ "move_tab_to_new_window": "Move this tab to a new window",
+ "new_tab": "New tab"
+ },
+ "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"
+ },
+ "app_context": {
+ "please_wait_for_save": "Please wait for a couple of seconds for the save to finish, then you can try again."
}
}