diff --git a/src/public/app/widgets/type_widgets/attachment_detail.js b/src/public/app/widgets/type_widgets/attachment_detail.js index fbc38e561..9bdec99ad 100644 --- a/src/public/app/widgets/type_widgets/attachment_detail.js +++ b/src/public/app/widgets/type_widgets/attachment_detail.js @@ -3,6 +3,7 @@ import AttachmentDetailWidget from "../attachment_detail.js"; import linkService from "../../services/link.js"; import froca from "../../services/froca.js"; import utils from "../../services/utils.js"; +import { t } from "../../services/i18n.js"; const TPL = `
@@ -47,15 +48,15 @@ export default class AttachmentDetailTypeWidget extends TypeWidget { this.$wrapper.empty(); this.children = []; - const $helpButton = $(''); + const $helpButton = $(''); utils.initHelpButtons($helpButton); this.$linksWrapper.empty().append( - "Owning note: ", + t('attachment_detail.owning_note'), await linkService.createLink(this.noteId), - ", you can also open the ", + t('attachment_detail.you_can_also_open'), await linkService.createLink(this.noteId, { - title: 'List of all attachments', + title: t('attachment_detail.list_of_all_attachments'), viewScope: { viewMode: 'attachments' } @@ -66,8 +67,7 @@ export default class AttachmentDetailTypeWidget extends TypeWidget { const attachment = await froca.getAttachment(this.attachmentId, true); if (!attachment) { - this.$wrapper.html("This attachment has been deleted."); - + this.$wrapper.html("" + t('attachment_detail.attachment_deleted') + ""); return; } diff --git a/src/public/app/widgets/type_widgets/attachment_list.js b/src/public/app/widgets/type_widgets/attachment_list.js index 8f6aa9f9e..5bb458703 100644 --- a/src/public/app/widgets/type_widgets/attachment_list.js +++ b/src/public/app/widgets/type_widgets/attachment_list.js @@ -2,6 +2,7 @@ import TypeWidget from "./type_widget.js"; import AttachmentDetailWidget from "../attachment_detail.js"; import linkService from "../../services/link.js"; import utils from "../../services/utils.js"; +import { t } from "../../services/i18n.js"; const TPL = `
@@ -39,19 +40,19 @@ export default class AttachmentListTypeWidget extends TypeWidget { } async doRefresh(note) { - const $helpButton = $(''); + const $helpButton = $(''); utils.initHelpButtons($helpButton); const noteLink = await linkService.createLink(this.noteId); // do separately to avoid race condition between empty() and .append() this.$linksWrapper.empty().append( $('
').append( - "Owning note: ", + t('attachment_list.owning_note'), noteLink, ), $('
').append( $(' +
`; diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 6e73be290..2f2ecd695 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -853,5 +853,39 @@ "label_year_comparison": "数字比较(也包括>,>=,<)。", "label_date_created": "上个月创建的笔记", "error": "搜索错误:{{error}}" + }, + "attachment_detail": { + "open_help_page": "打开附件帮助页面", + "owning_note": "所属笔记: ", + "you_can_also_open": ",你还可以打开", + "list_of_all_attachments": "所有附件列表", + "attachment_deleted": "该附件已被删除。" + }, + "attachment_list": { + "open_help_page": "打开附件帮助页面", + "owning_note": "所属笔记: ", + "upload_attachments": "上传附件", + "no_attachments": "此笔记没有附件。" + }, + "book": { + "no_children_help": "此类型为书籍的笔记没有任何子笔记,因此没有内容显示。请参阅 wiki 了解详情" + }, + "editable_code": { + "placeholder": "在这里输入您的代码笔记内容..." + }, + "editable_text": { + "placeholder": "在这里输入您的笔记内容..." + }, + "empty": { + "open_note_instruction": "通过在下面的输入框中输入笔记标题或在树中选择笔记来打开笔记。", + "search_placeholder": "按名称搜索笔记", + "enter_workspace": "进入工作区 {{title}}" + }, + "file": { + "file_preview_not_available": "此文件格式不支持预览。" + }, + "protected_session": { + "enter_password_instruction": "显示受保护的笔记需要输入您的密码:", + "start_session_button": "开始受保护的会话" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 67a753820..9ec0a91ad 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -854,5 +854,39 @@ "label_year_comparison": "numerical comparison (also >, >=, <).", "label_date_created": "notes created in the last month", "error": "Search error: {{error}}" + }, + "attachment_detail": { + "open_help_page": "Open help page on attachments", + "owning_note": "Owning note: ", + "you_can_also_open": ", you can also open the ", + "list_of_all_attachments": "List of all attachments", + "attachment_deleted": "This attachment has been deleted." + }, + "attachment_list": { + "open_help_page": "Open help page on attachments", + "owning_note": "Owning note: ", + "upload_attachments": "Upload attachments", + "no_attachments": "This note has no attachments." + }, + "book": { + "no_children_help": "This note of type Book doesn't have any child notes so there's nothing to display. See wiki for details." + }, + "editable_code": { + "placeholder": "Type the content of your code note here..." + }, + "editable_text": { + "placeholder": "Type the content of your note here ..." + }, + "empty": { + "open_note_instruction": "Open a note by typing the note's title into the input below or choose a note in the tree.", + "search_placeholder": "search for a note by its name", + "enter_workspace": "Enter workspace {{title}}" + }, + "file": { + "file_preview_not_available": "File preview is not available for this file format." + }, + "protected_session": { + "enter_password_instruction": "Showing protected note requires entering your password:", + "start_session_button": "Start protected session" } }