From 835891999efd0d0549b8130f09876f479180eac1 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Mon, 5 Aug 2024 10:59:26 +0800 Subject: [PATCH] add translation for ribbon widgets: note_paths.js --- .../app/widgets/ribbon_widgets/note_paths.js | 21 +++++++++---------- src/public/translations/cn/translation.json | 9 ++++++++ src/public/translations/en/translation.json | 9 ++++++++ 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/public/app/widgets/ribbon_widgets/note_paths.js b/src/public/app/widgets/ribbon_widgets/note_paths.js index 7d8f2102d..45fd04122 100644 --- a/src/public/app/widgets/ribbon_widgets/note_paths.js +++ b/src/public/app/widgets/ribbon_widgets/note_paths.js @@ -1,6 +1,7 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js"; import treeService from "../../services/tree.js"; import linkService from "../../services/link.js"; +import { t } from "../../services/i18n.js"; const TPL = `
@@ -32,7 +33,7 @@ const TPL = ` - +
`; export default class NotePathsWidget extends NoteContextAwareWidget { @@ -47,7 +48,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget { getTitle() { return { show: true, - title: 'Note Paths', + title: t("note_paths.title"), icon: 'bx bx-collection' }; } @@ -76,10 +77,9 @@ export default class NotePathsWidget extends NoteContextAwareWidget { .filter(notePath => !notePath.isHidden); if (sortedNotePaths.length > 0) { - this.$notePathIntro.text("This note is placed into the following paths:"); - } - else { - this.$notePathIntro.text("This note is not yet placed into the note tree."); + this.$notePathIntro.text(t("note_paths.intro_placed")); + } else { + this.$notePathIntro.text(t("note_paths.intro_not_placed")); } const renderedPaths = []; @@ -110,21 +110,20 @@ export default class NotePathsWidget extends NoteContextAwareWidget { if (!notePathRecord || notePathRecord.isInHoistedSubTree) { $noteLink.addClass("path-in-hoisted-subtree"); - } - else { - icons.push(``); + } else { + icons.push(``); } if (notePathRecord?.isArchived) { $noteLink.addClass("path-archived"); - icons.push(``); + icons.push(``); } if (notePathRecord?.isSearch) { $noteLink.addClass("path-search"); - icons.push(``); + icons.push(``); } if (icons.length > 0) { diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 6ea3d5c44..ccb3f3d05 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -721,5 +721,14 @@ "open_full": "展开显示", "collapse": "折叠到正常大小", "title": "笔记地图" + }, + "note_paths": { + "title": "笔记路径", + "clone_button": "克隆笔记到新位置...", + "intro_placed": "此笔记放置在以下路径中:", + "intro_not_placed": "此笔记尚未放入笔记树中。", + "outside_hoisted": "此路径在提升的笔记之外,您需要取消提升。", + "archived": "已归档", + "search": "搜索" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 059dea807..1d959ee03 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -722,5 +722,14 @@ "open_full": "Expand to full", "collapse": "Collapse to normal size", "title": "Note Map" + }, + "note_paths": { + "title": "Note Paths", + "clone_button": "Clone note to new location...", + "intro_placed": "This note is placed into the following paths:", + "intro_not_placed": "This note is not yet placed into the note tree.", + "outside_hoisted": "This path is outside of hoisted note and you would have to unhoist.", + "archived": "Archived", + "search": "Search" } }