diff --git a/src/public/app/widgets/ribbon_widgets/note_info_widget.js b/src/public/app/widgets/ribbon_widgets/note_info_widget.js index 8bf220761..d6df63bd9 100644 --- a/src/public/app/widgets/ribbon_widgets/note_info_widget.js +++ b/src/public/app/widgets/ribbon_widgets/note_info_widget.js @@ -1,6 +1,7 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js"; import server from "../../services/server.js"; import utils from "../../services/utils.js"; +import { t } from "../../services/i18n.js"; const TPL = `
`; + export default class NoteInfoWidget extends NoteContextAwareWidget { get name() { return "noteInfo"; @@ -78,7 +76,7 @@ export default class NoteInfoWidget extends NoteContextAwareWidget { getTitle() { return { show: this.isEnabled(), - title: 'Note Info', + title: t("note_info_widget.title"), icon: 'bx bx-info-circle' }; } @@ -111,9 +109,8 @@ export default class NoteInfoWidget extends NoteContextAwareWidget { const subTreeResp = await server.get(`stats/subtree-size/${this.noteId}`); if (subTreeResp.subTreeNoteCount > 1) { - this.$subTreeSize.text(`(subtree size: ${utils.formatSize(subTreeResp.subTreeSize)} in ${subTreeResp.subTreeNoteCount} notes)`); - } - else { + this.$subTreeSize.text(t("note_info_widget.subtree_size", { size: utils.formatSize(subTreeResp.subTreeSize), count: subTreeResp.subTreeNoteCount })); + } else { this.$subTreeSize.text(""); } }); @@ -143,7 +140,7 @@ export default class NoteInfoWidget extends NoteContextAwareWidget { this.$noteSizesWrapper.hide(); } - entitiesReloadedEvent({loadResults}) { + entitiesReloadedEvent({ loadResults }) { if (loadResults.isNoteReloaded(this.noteId) || loadResults.isNoteContentReloaded(this.noteId)) { this.refresh(); } diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 5bfc4eaa4..8c962c6d6 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -705,5 +705,16 @@ "inherited_attribute_list": { "title": "继承的属性", "no_inherited_attributes": "没有继承的属性。" + }, + "note_info_widget": { + "note_id": "笔记ID", + "created": "创建时间", + "modified": "修改时间", + "type": "类型", + "note_size": "笔记大小", + "note_size_info": "笔记大小提供了该笔记存储需求的粗略估计。它考虑了笔记的内容及其笔记修订的内容。", + "calculate": "计算", + "subtree_size": "(子树大小: {{size}}, 共计 {{count}} 个笔记)", + "title": "笔记信息" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index a9ac06123..080166e9d 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -706,5 +706,16 @@ "inherited_attribute_list": { "title": "Inherited Attributes", "no_inherited_attributes": "No inherited attributes." + }, + "note_info_widget": { + "note_id": "Note ID", + "created": "Created", + "modified": "Modified", + "type": "Type", + "note_size": "Note size", + "note_size_info": "Note size provides rough estimate of storage requirements for this note. It takes into account note's content and content of its note revisions.", + "calculate": "calculate", + "subtree_size": "(subtree size: {{size}} in {{count}} notes)", + "title": "Note Info" } }