From e4271d3945848540f6f77c7c07de98b4cc2c4094 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:29:44 +0800 Subject: [PATCH 1/4] update missing translation --- src/public/translations/cn/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 3b3293ba3..adb3220df 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -132,7 +132,7 @@ "pasteNotes": "将笔记粘贴为活动笔记的子笔记(根据是复制还是剪切到剪贴板来决定是移动还是克隆)", "deleteNotes": "删除笔记/子树", "editingNotes": "编辑笔记", - "editNoteTitle": "", + "editNoteTitle": "在树形笔记树中,焦点会从笔记树切换到笔记标题。按下 Enter 键会将焦点从笔记标题切换到文本编辑器。按下 Ctrl+. 会将焦点从编辑器切换回笔记树。", "createEditLink": "创建/编辑外部链接", "createInternalLink": "创建内部链接", "followLink": "跟随光标下的链接", From 87de631af4dc0901bfcdce69da95553d5c437f4d Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:53:50 +0800 Subject: [PATCH 2/4] sync Chinese translation with English --- src/public/translations/cn/translation.json | 106 ++++++++++++++++++-- 1 file changed, 96 insertions(+), 10 deletions(-) diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index adb3220df..1421197ec 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -187,6 +187,12 @@ "search_placeholder": "按笔记名称搜索", "search_button": "全文搜索 Ctrl+回车" }, + "markdown_import": { + "dialog_title": "Markdown 导入", + "modal_body_text": "由于浏览器沙箱的限制,无法直接从 JavaScript 读取剪贴板内容。请将要导入的 Markdown 文本粘贴到下面的文本框中,然后点击导入按钮", + "import_button": "导入 Ctrl+回车", + "import_success": "Markdown 内容已成功导入文档。" + }, "move_to": { "dialog_title": "移动笔记到...", "notes_to_move": "需要移动的笔记", @@ -196,12 +202,6 @@ "error_no_path": "没有可以移动到的路径。", "move_success_message": "所选笔记已移动到 " }, - "markdown_import": { - "dialog_title": "Markdown 导入", - "modal_body_text": "由于浏览器沙箱的限制,无法直接从 JavaScript 读取剪贴板内容。请将要导入的 Markdown 文本粘贴到下面的文本框中,然后点击导入按钮", - "import_button": "导入 Ctrl+回车", - "import_success": "Markdown 内容已成功导入文档。" - }, "note_type_chooser": { "modal_title": "选择笔记类型", "modal_body": "选择新笔记的类型或模板:", @@ -567,6 +567,12 @@ "edit_button": { "edit_this_note": "编辑此笔记" }, + "show_toc_widget_button": { + "show_toc": "显示目录" + }, + "show_highlights_list_widget_button": { + "show_highlights_list": "显示高亮列表" + }, "global_menu": { "menu": "菜单", "options": "选项", @@ -602,8 +608,8 @@ "in_progress": "正在与服务器进行同步。" }, "left_pane_toggle": { - "hide_panel": "隐藏面板", - "show_panel": "显示面板" + "show_panel": "显示面板", + "hide_panel": "隐藏面板" }, "move_pane_button": { "move_left": "向左移动", @@ -653,6 +659,9 @@ "hide_floating_buttons_button": { "button_title": "隐藏按钮" }, + "svg_export_button": { + "button_title": "导出SVG格式图片" + }, "relation_map_buttons": { "create_child_note_title": "创建新的子笔记并添加到关系图", "reset_pan_zoom_title": "重置平移和缩放到初始坐标和放大倍率", @@ -1123,7 +1132,10 @@ }, "i18n": { "title": "本地化", - "language": "语言" + "language": "语言", + "first-day-of-the-week": "一周的第一天", + "sunday": "星期日", + "monday": "星期一" }, "backup": { "automatic_backup": "自动备份", @@ -1249,5 +1261,79 @@ "note_is_editable": "笔记如果不太长则可编辑。", "note_is_read_only": "笔记为只读,但可以通过点击按钮进行编辑。", "note_is_always_editable": "无论笔记长度如何,始终可编辑。" - } + }, +"note-map": { + "button-link-map": "链接地图", + "button-tree-map": "树形地图" + }, + "tree-context-menu": { + "open-in-a-new-tab": "在新标签页中打开", + "open-in-a-new-split": "在新分栏中打开", + "insert-note-after": "在后面插入笔记", + "insert-child-note": "插入子笔记", + "delete": "删除", + "search-in-subtree": "在子树中搜索", + "edit-branch-prefix": "编辑分支前缀", + "advanced": "高级", + "expand-subtree": "展开子树", + "collapse-subtree": "折叠子树", + "sort-by": "排序方式...", + "recent-changes-in-subtree": "子树中的最近更改", + "convert-to-attachment": "转换为附件", + "copy-note-path-to-clipboard": "复制笔记路径到剪贴板", + "protect-subtree": "保护子树", + "unprotect-subtree": "取消保护子树", + "copy-clone": "复制 / 克隆", + "clone-to": "克隆到...", + "cut": "剪切", + "move-to": "移动到...", + "paste-into": "粘贴到里面", + "paste-after": "粘贴到后面", + "duplicate-subtree": "复制子树", + "export": "导出", + "import-into-note": "导入到笔记", + "apply-bulk-actions": "应用批量操作" + }, + "shared_info": { + "shared_publicly": "此笔记已公开分享在", + "shared_locally": "此笔记已在本地分享在", + "help_link": "如需帮助,请访问 wiki。" + }, + "note_types": { + "text": "文本", + "code": "代码", + "saved-search": "保存的搜索", + "relation-map": "关系图", + "note-map": "笔记地图", + "render-note": "渲染笔记", + "book": "书", + "mermaid-diagram": "美人鱼图", + "canvas": "画布", + "web-view": "网页视图", + "mind-map": "思维导图", + "file": "文件", + "image": "图片", + "launcher": "启动器", + "doc": "文档", + "widget": "小部件" + }, + "protect_note": { + "toggle-on": "保护笔记", + "toggle-off": "取消保护笔记", + "toggle-on-hint": "笔记未受保护,点击以保护", + "toggle-off-hint": "笔记已受保护,点击以取消保护" + }, + "shared_switch": { + "shared": "已分享", + "toggle-on-title": "分享笔记", + "toggle-off-title": "取消分享笔记", + "shared-branch": "此笔记仅作为共享笔记存在,取消共享将删除它。你确定要继续并删除此笔记吗?", + "inherited": "此笔记无法在此处取消共享,因为它通过继承自上级笔记共享。" + }, + "template_switch": { + "template": "模板", + "toggle-on-hint": "将此笔记设为模板", + "toggle-off-hint": "取消笔记模板设置" + }, + "open-help-page": "打开帮助页面" } From 83388ecf1c8fe5f7d50160ec362dd4a331f90b0b Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:10:59 +0800 Subject: [PATCH 3/4] add translation for 2 widgets --- src/public/app/widgets/find.js | 9 +++++---- src/public/app/widgets/highlights_list.js | 5 +++-- src/public/translations/cn/translation.json | 10 +++++++++- src/public/translations/en/translation.json | 18 +++++++++++++----- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/public/app/widgets/find.js b/src/public/app/widgets/find.js index cf505aab1..5c24c36fa 100644 --- a/src/public/app/widgets/find.js +++ b/src/public/app/widgets/find.js @@ -3,6 +3,7 @@ * https://github.com/antoniotejada/Trilium-FindWidget */ +import { t } from "../services/i18n.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import FindInText from "./find_in_text.js"; import FindInCode from "./find_in_code.js"; @@ -53,12 +54,12 @@ const TPL = `
- +
- +
@@ -273,7 +274,7 @@ export default class FindWidget extends NoteContextAwareWidget { async entitiesReloadedEvent({loadResults}) { if (loadResults.isNoteContentReloaded(this.noteId)) { - this.$totalFound.text("?") - } + this.$totalFound.text("?") + } } } diff --git a/src/public/app/widgets/highlights_list.js b/src/public/app/widgets/highlights_list.js index 6c728c8b3..ef4a0c2ac 100644 --- a/src/public/app/widgets/highlights_list.js +++ b/src/public/app/widgets/highlights_list.js @@ -5,6 +5,7 @@ * - For example, if there is a formula in the middle of the highlighted text, the two ends of the formula will be regarded as two entries */ +import { t } from "../services/i18n.js"; import attributeService from "../services/attributes.js"; import RightPanelWidget from "./right_panel_widget.js"; import options from "../services/options.js"; @@ -43,14 +44,14 @@ const TPL = `
export default class HighlightsListWidget extends RightPanelWidget { get widgetTitle() { - return "Highlights List"; + return t("highlights_list_2.title"); } get widgetButtons() { return [ new OnClickButtonWidget() .icon("bx-cog") - .title("Options") + .title(t("highlights_list_2.options")) .titlePlacement("left") .onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', { activate: true })) .class("icon-action"), diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 1421197ec..892ac1c39 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -1335,5 +1335,13 @@ "toggle-on-hint": "将此笔记设为模板", "toggle-off-hint": "取消笔记模板设置" }, - "open-help-page": "打开帮助页面" + "open-help-page": "打开帮助页面", + "find": { + "case_sensitive": "区分大小写", + "match_words": "匹配单词" + }, + "highlights_list_2": { + "title": "高亮列表", + "options": "选项" + } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 8f661f08b..9e2c4916b 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -602,10 +602,10 @@ "sync_status": { "unknown": "

Sync status will be known once the next sync attempt starts.

Click to trigger sync now.

", "connected_with_changes": "

Connected to the sync server.
There are some outstanding changes yet to be synced.

Click to trigger sync.

", - "connected_no_changes":"

Connected to the sync server.
All changes have been already synced.

Click to trigger sync.

", - "disconnected_with_changes":"

Establishing the connection to the sync server was unsuccessful.
There are some outstanding changes yet to be synced.

Click to trigger sync.

", - "disconnected_no_changes":"

Establishing the connection to the sync server was unsuccessful.
All known changes have been synced.

Click to trigger sync.

", - "in_progress":"Sync with the server is in progress." + "connected_no_changes": "

Connected to the sync server.
All changes have been already synced.

Click to trigger sync.

", + "disconnected_with_changes": "

Establishing the connection to the sync server was unsuccessful.
There are some outstanding changes yet to be synced.

Click to trigger sync.

", + "disconnected_no_changes": "

Establishing the connection to the sync server was unsuccessful.
All known changes have been synced.

Click to trigger sync.

", + "in_progress": "Sync with the server is in progress." }, "left_pane_toggle": { "show_panel": "Show panel", @@ -1335,5 +1335,13 @@ "toggle-on-hint": "Make the note a template", "toggle-off-hint": "Remove the note as a template" }, - "open-help-page": "Open help page" + "open-help-page": "Open help page", + "find": { + "case_sensitive": "case sensitive", + "match_words": "match words" + }, + "highlights_list_2": { + "title": "Highlights List", + "options": "Options" + } } From f5b21498bfc441c66622e9831c5d56cba7ae68e1 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:24:42 +0800 Subject: [PATCH 4/4] add translation for mermaid.js --- src/public/app/widgets/mermaid.js | 3 ++- src/public/translations/cn/translation.json | 3 +++ src/public/translations/en/translation.json | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/mermaid.js b/src/public/app/widgets/mermaid.js index c7d40488f..a05561ac0 100644 --- a/src/public/app/widgets/mermaid.js +++ b/src/public/app/widgets/mermaid.js @@ -1,3 +1,4 @@ +import { t } from "../services/i18n.js"; import libraryLoader from "../services/library_loader.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import server from "../services/server.js"; @@ -27,7 +28,7 @@ const TPL = `
-

The diagram could not be displayed. See help and examples.

+

${t('mermaid.diagram_error')}

diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 892ac1c39..c6441410a 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -1343,5 +1343,8 @@ "highlights_list_2": { "title": "高亮列表", "options": "选项" + }, + "mermaid": { + "diagram_error": "图表无法显示。 请参考 帮助文档和示例。" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 9e2c4916b..0b477117c 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1343,5 +1343,8 @@ "highlights_list_2": { "title": "Highlights List", "options": "Options" + }, + "mermaid": { + "diagram_error": "The diagram could not be displayed. See help and examples." } }