From d9a7671830abb4d440afb379ed0e9036bc9b4d70 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:28:46 +0800 Subject: [PATCH 1/2] update Chinese translation and synchronize with English --- src/public/translations/cn/translation.json | 30 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index c6441410a..6818e2214 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -408,7 +408,8 @@ "add_new_label": "添加新标签 ", "add_new_relation": "添加新关系 ", "add_new_label_definition": "添加新标签定义", - "add_new_relation_definition": "添加新关系定义" + "add_new_relation_definition": "添加新关系定义", + "placeholder": "在此输入标签和关系" }, "abstract_bulk_action": { "remove_this_search_action": "删除此搜索操作" @@ -659,6 +660,9 @@ "hide_floating_buttons_button": { "button_title": "隐藏按钮" }, + "show_floating_buttons_button": { + "button_title": "显示按钮" + }, "svg_export_button": { "button_title": "导出SVG格式图片" }, @@ -680,7 +684,10 @@ "error_unrecognized_command": "无法识别的命令 {{command}}" }, "note_icon": { - "change_note_icon": "更改笔记图标" + "change_note_icon": "更改笔记图标", + "category": "类别:", + "search": "搜索:", + "reset-default": "重置为默认图标" }, "basic_properties": { "note_type": "笔记类型", @@ -1346,5 +1353,24 @@ }, "mermaid": { "diagram_error": "图表无法显示。 请参考 帮助文档和示例。" + }, + "quick-search": { + "placeholder": "快速搜索", + "searching": "正在搜索...", + "no-results": "未找到结果", + "more-results": "... 以及另外 {{number}} 个结果。", + "show-in-full-search": "在完整的搜索界面中显示" + }, + "note_tree": { + "collapse-title": "折叠笔记树", + "scroll-active-title": "滚动到活动笔记", + "tree-settings-title": "树设置", + "hide-archived-notes": "隐藏已归档笔记", + "automatically-collapse-notes": "自动折叠笔记", + "automatically-collapse-notes-title": "笔记在一段时间内未使用将被折叠,以减少树形结构的杂乱。", + "save-changes": "保存并应用更改" + }, + "title_bar_buttons": { + "window-on-top": "保持此窗口置顶" } } From eb9b4aee21eae54abb822d27d6e0ea394df480ce Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:57:16 +0800 Subject: [PATCH 2/2] add translation for 6 widgets --- src/public/app/widgets/note_detail.js | 3 ++- src/public/app/widgets/note_title.js | 3 ++- src/public/app/widgets/search_result.js | 5 +++-- src/public/app/widgets/spacer.js | 3 ++- src/public/app/widgets/sql_result.js | 3 ++- src/public/app/widgets/sql_table_schemas.js | 3 ++- src/public/translations/cn/translation.json | 19 +++++++++++++++++++ src/public/translations/en/translation.json | 19 +++++++++++++++++++ 8 files changed, 51 insertions(+), 7 deletions(-) diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.js index 91aa9998e..19544b7cb 100644 --- a/src/public/app/widgets/note_detail.js +++ b/src/public/app/widgets/note_detail.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import protectedSessionHolder from "../services/protected_session_holder.js"; import SpacedUpdate from "../services/spaced_update.js"; @@ -155,7 +156,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget { getTypeWidget() { if (!this.typeWidgets[this.type]) { - throw new Error(`Could not find typeWidget for type '${this.type}'`); + throw new Error(t(`note_detail.could_not_find_typewidget`, { type: this.type })); } return this.typeWidgets[this.type]; diff --git a/src/public/app/widgets/note_title.js b/src/public/app/widgets/note_title.js index 14fcff9ae..7164e3aa1 100644 --- a/src/public/app/widgets/note_title.js +++ b/src/public/app/widgets/note_title.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import protectedSessionHolder from "../services/protected_session_holder.js"; import server from "../services/server.js"; @@ -27,7 +28,7 @@ const TPL = ` } - + `; export default class NoteTitleWidget extends NoteContextAwareWidget { diff --git a/src/public/app/widgets/search_result.js b/src/public/app/widgets/search_result.js index 159702f6e..390ecdae8 100644 --- a/src/public/app/widgets/search_result.js +++ b/src/public/app/widgets/search_result.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteListRenderer from "../services/note_list_renderer.js"; @@ -22,11 +23,11 @@ const TPL = `