Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
add translation for ribbon widgets: file_properties.js
Nriverc2a8f4f4a382
diff --git a/src/public/app/widgets/ribbon_widgets/file_properties.js b/src/public/app/widgets/ribbon_widgets/file_properties.jsindex 1d543cef52..bdab79a254 100644--- a/src/public/app/widgets/ribbon_widgets/file_properties.js+++ b/src/public/app/widgets/ribbon_widgets/file_properties.js@@ -4,6 +4,7 @@ import toastService from "../../services/toast.js";import openService from "../../services/open.js";import utils from "../../services/utils.js";import protectedSessionHolder from "../../services/protected_session_holder.js";+import { t } from "../../services/i18n.js";const TPL = `<div class="file-properties-widget">@@ -27,26 +28,26 @@ const TPL = `<table class="file-table"><tr>- <th>Note ID:</th>+ <th>${t("file_properties.note_id")}:</th><td class="file-note-id"></td>- <th>Original file name:</th>+ <th>${t("file_properties.original_file_name")}:</th><td class="file-filename"></td></tr><tr>- <th>File type:</th>+ <th>${t("file_properties.file_type")}:</th><td class="file-filetype"></td>- <th>File size:</th>+ <th>${t("file_properties.file_size")}:</th><td class="file-filesize"></td></tr><tr><td colspan="4"><div class="file-buttons">- <button class="file-download btn btn-sm btn-primary" type="button">Download</button>+ <button class="file-download btn btn-sm btn-primary" type="button">${t("file_properties.download")}</button> - <button class="file-open btn btn-sm btn-primary" type="button">Open</button>+ <button class="file-open btn btn-sm btn-primary" type="button">${t("file_properties.open")}</button> - <button class="file-upload-new-revision btn btn-sm btn-primary">Upload new revision</button>+ <button class="file-upload-new-revision btn btn-sm btn-primary">${t("file_properties.upload_new_revision")}</button><input type="file" class="file-upload-new-revision-input" style="display: none"></div>@@ -72,7 +73,7 @@ export default class FilePropertiesWidget extends NoteContextAwareWidget {return {show: this.isEnabled(),activate: true,- title: 'File',+ title: t("file_properties.title"),icon: 'bx bx-file'};}@@ -103,12 +104,11 @@ export default class FilePropertiesWidget extends NoteContextAwareWidget {const result = await server.upload(`notes/${this.noteId}/file`, fileToUpload);if (result.uploaded) {- toastService.showMessage("New file revision has been uploaded.");+ toastService.showMessage(t("file_properties.upload_success"));this.refresh();- }- else {- toastService.showError("Upload of a new file revision failed.");+ } else {+ toastService.showError(t("file_properties.upload_failed"));}});}@@ -126,7 +126,7 @@ export default class FilePropertiesWidget extends NoteContextAwareWidget {// open doesn't work for protected notes since it works through a browser which isn't in protected sessionthis.$openButton.toggle(!note.isProtected);- this.$downloadButton.toggle(!note.isProtected || protectedSessionHolder.isProtectedSessionAvailable())- this.$uploadNewRevisionButton.toggle(!note.isProtected || protectedSessionHolder.isProtectedSessionAvailable())+ this.$downloadButton.toggle(!note.isProtected || protectedSessionHolder.isProtectedSessionAvailable());+ this.$uploadNewRevisionButton.toggle(!note.isProtected || protectedSessionHolder.isProtectedSessionAvailable());}}diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.jsonindex cf6e6499dc..3b9e07459b 100644--- a/src/public/translations/cn/translation.json+++ b/src/public/translations/cn/translation.json@@ -677,5 +677,17 @@"no_edited_notes_found": "今天还没有编辑过的笔记...","title": "编辑过的笔记","deleted": "(已删除)"+ },+ "file_properties": {+ "note_id": "笔记 ID",+ "original_file_name": "原始文件名",+ "file_type": "文件类型",+ "file_size": "文件大小",+ "download": "下载",+ "open": "打开",+ "upload_new_revision": "上传新修改",+ "upload_success": "新文件修改已上传。",+ "upload_failed": "新文件修改上传失败。",+ "title": "文件"}}diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex 12d26e8889..83f4f86d67 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -678,5 +678,17 @@"no_edited_notes_found": "No edited notes on this day yet ...","title": "Edited Notes","deleted": "(deleted)"+ },+ "file_properties": {+ "note_id": "Note ID",+ "original_file_name": "Original file name",+ "file_type": "File type",+ "file_size": "File size",+ "download": "Download",+ "open": "Open",+ "upload_new_revision": "Upload new revision",+ "upload_success": "New file revision has been uploaded.",+ "upload_failed": "Upload of a new file revision failed.",+ "title": "File"}}