From d6aa4d26dd9b1ace474d0431438a3b441d7ec0ec Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:37:03 +0800 Subject: [PATCH] add translation for all other options --- .../other/attachment_erasure_timeout.js | 13 +++--- .../options/other/network_connections.js | 5 ++- .../options/other/note_erasure_timeout.js | 16 +++---- .../other/revisions_snapshot_interval.js | 7 +-- .../options/other/search_engine.js | 25 +++++------ .../type_widgets/options/other/tray.js | 5 ++- src/public/translations/cn/translation.json | 43 +++++++++++++++++++ src/public/translations/en/translation.json | 43 +++++++++++++++++++ 8 files changed, 123 insertions(+), 34 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/other/attachment_erasure_timeout.js b/src/public/app/widgets/type_widgets/options/other/attachment_erasure_timeout.js index e0d25f2bd..acac8c90f 100644 --- a/src/public/app/widgets/type_widgets/options/other/attachment_erasure_timeout.js +++ b/src/public/app/widgets/type_widgets/options/other/attachment_erasure_timeout.js @@ -1,21 +1,22 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Attachment Erasure Timeout

+

${t("attachment_erasure_timeout.attachment_erasure_timeout")}

-

Attachments get automatically deleted (and erased) if they are not referenced by their note anymore after a defined time out.

+

${t("attachment_erasure_timeout.attachment_auto_deletion_description")}

- +
-

You can also trigger erasing manually (without considering the timeout defined above):

+

${t("attachment_erasure_timeout.manual_erasing_description")}

- +
`; export default class AttachmentErasureTimeoutOptions extends OptionsWidget { @@ -27,7 +28,7 @@ export default class AttachmentErasureTimeoutOptions extends OptionsWidget { this.$eraseUnusedAttachmentsNowButton = this.$widget.find(".erase-unused-attachments-now-button"); this.$eraseUnusedAttachmentsNowButton.on('click', () => { server.post('notes/erase-unused-attachments-now').then(() => { - toastService.showMessage("Unused attachments have been erased."); + toastService.showMessage(t("attachment_erasure_timeout.unused_attachments_erased")); }); }); } diff --git a/src/public/app/widgets/type_widgets/options/other/network_connections.js b/src/public/app/widgets/type_widgets/options/other/network_connections.js index f4cedb968..e723d32e0 100644 --- a/src/public/app/widgets/type_widgets/options/other/network_connections.js +++ b/src/public/app/widgets/type_widgets/options/other/network_connections.js @@ -1,12 +1,13 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Network Connections

+

${t("network_connections.network_connections_title")}

`; diff --git a/src/public/app/widgets/type_widgets/options/other/note_erasure_timeout.js b/src/public/app/widgets/type_widgets/options/other/note_erasure_timeout.js index e58f95fc3..6733b8535 100644 --- a/src/public/app/widgets/type_widgets/options/other/note_erasure_timeout.js +++ b/src/public/app/widgets/type_widgets/options/other/note_erasure_timeout.js @@ -1,24 +1,22 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Note Erasure Timeout

+

${t("note_erasure_timeout.note_erasure_timeout_title")}

-

Deleted notes (and attributes, revisions...) are at first only marked as deleted and it is possible to recover them - from Recent Notes dialog. After a period of time, deleted notes are "erased" which means - their content is not recoverable anymore. This setting allows you to configure the length - of the period between deleting and erasing the note.

+

${t("note_erasure_timeout.note_erasure_description")}

- +
-

You can also trigger erasing manually (without considering the timeout defined above):

+

${t("note_erasure_timeout.manual_erasing_description")}

- +
`; export default class NoteErasureTimeoutOptions extends OptionsWidget { @@ -30,7 +28,7 @@ export default class NoteErasureTimeoutOptions extends OptionsWidget { this.$eraseDeletedNotesButton = this.$widget.find(".erase-deleted-notes-now-button"); this.$eraseDeletedNotesButton.on('click', () => { server.post('notes/erase-deleted-notes-now').then(() => { - toastService.showMessage("Deleted notes have been erased."); + toastService.showMessage(t("note_erasure_timeout.deleted_notes_erased")); }); }); } diff --git a/src/public/app/widgets/type_widgets/options/other/revisions_snapshot_interval.js b/src/public/app/widgets/type_widgets/options/other/revisions_snapshot_interval.js index a959c5b7b..d0758c9e7 100644 --- a/src/public/app/widgets/type_widgets/options/other/revisions_snapshot_interval.js +++ b/src/public/app/widgets/type_widgets/options/other/revisions_snapshot_interval.js @@ -1,13 +1,14 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Note Revisions Snapshot Interval

+

${t("revisions_snapshot_interval.note_revisions_snapshot_interval_title")}

-

Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See wiki for more info.

+

${t("revisions_snapshot_interval.note_revisions_snapshot_description")}

- +
`; diff --git a/src/public/app/widgets/type_widgets/options/other/search_engine.js b/src/public/app/widgets/type_widgets/options/other/search_engine.js index 4d387a4b0..0f03e330f 100644 --- a/src/public/app/widgets/type_widgets/options/other/search_engine.js +++ b/src/public/app/widgets/type_widgets/options/other/search_engine.js @@ -1,35 +1,36 @@ import OptionsWidget from "../options_widget.js"; import utils from "../../../../services/utils.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Search Engine

+

${t("search_engine.title")}

-

Custom search engine requires both a name and a URL to be set. If either of these is not set, DuckDuckGo will be used as the default search engine.

+

${t("search_engine.custom_search_engine_info")}

- +
- - + +
- - + +
- +
`; diff --git a/src/public/app/widgets/type_widgets/options/other/tray.js b/src/public/app/widgets/type_widgets/options/other/tray.js index e0cfdac62..c20469ce7 100644 --- a/src/public/app/widgets/type_widgets/options/other/tray.js +++ b/src/public/app/widgets/type_widgets/options/other/tray.js @@ -1,12 +1,13 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Tray

+

${t("tray.title")}

`; diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 1a4ad0b56..e06342b19 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -1042,5 +1042,48 @@ "enable_image_compression": "启用图片压缩", "max_image_dimensions": "图片的最大宽度/高度(超过此限制的图像将会被缩放)。", "jpeg_quality_description": "JPEG 质量(10 - 最差质量,100 最佳质量,建议为 50 - 85)" + }, + "attachment_erasure_timeout": { + "attachment_erasure_timeout": "附件清理超时", + "attachment_auto_deletion_description": "如果附件在一段时间后不再被笔记引用,它们将自动被删除(并被清理)。", + "erase_attachments_after_x_seconds": "在附件在笔记中未被使用 X 秒后清理", + "manual_erasing_description": "您还可以手动触发清理(而不考虑上述定义的超时时间):", + "erase_unused_attachments_now": "立即清理未使用的附件笔记", + "unused_attachments_erased": "未使用的附件已被删除。" + }, + "network_connections": { + "network_connections_title": "网络连接", + "check_for_updates": "自动检查更新" + }, + "note_erasure_timeout": { + "note_erasure_timeout_title": "笔记清理超时", + "note_erasure_description": "被删除的笔记(以及属性、历史版本等)最初仅被标记为“删除”,可以从“最近修改”对话框中恢复它们。经过一段时间后,已删除的笔记会被“清理”,这意味着它们的内容将无法恢复。此设置允许您配置从删除到清除笔记之间的时间长度。", + "erase_notes_after_x_seconds": "在笔记删除 X 秒后清理", + "manual_erasing_description": "您还可以手动触发清理(不考虑上述定义的超时):", + "erase_deleted_notes_now": "立即清理已删除的笔记", + "deleted_notes_erased": "已删除的笔记已被清理。" + }, + "revisions_snapshot_interval": { + "note_revisions_snapshot_interval_title": "笔记修改快照间隔", + "note_revisions_snapshot_description": "笔记修改快照时间间隔是指经过多少秒后会为笔记创建新的修改历史。更多信息请参见wiki。", + "snapshot_time_interval_label": "笔记修改快照时间间隔(单位:秒)" + }, + "search_engine": { + "title": "搜索引擎", + "custom_search_engine_info": "自定义搜索引擎需要设置名称和URL。如果这两者之一未设置,将默认使用DuckDuckGo作为搜索引擎。", + "predefined_templates_label": "预定义搜索引擎模板", + "bing": "必应", + "baidu": "百度", + "duckduckgo": "DuckDuckGo", + "google": "谷歌", + "custom_name_label": "自定义搜索引擎名称", + "custom_name_placeholder": "自定义搜索引擎名称", + "custom_url_label": "自定义搜索引擎URL应包含 {keyword} 作为搜索词的占位符。", + "custom_url_placeholder": "自定义搜索引擎URL", + "save_button": "保存" + }, + "tray": { + "title": "托盘", + "enable_tray": "启用托盘图标(需要重启生效)" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 6a9e6eb28..f530302a7 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1043,5 +1043,48 @@ "enable_image_compression": "Enable image compression", "max_image_dimensions": "Max width / height of an image in pixels (image will be resized if it exceeds this setting).", "jpeg_quality_description": "JPEG quality (10 - worst quality, 100 best quality, 50 - 85 is recommended)" + }, + "attachment_erasure_timeout": { + "attachment_erasure_timeout": "Attachment Erasure Timeout", + "attachment_auto_deletion_description": "Attachments get automatically deleted (and erased) if they are not referenced by their note anymore after a defined time out.", + "erase_attachments_after_x_seconds": "Erase attachments after X seconds of not being used in its note", + "manual_erasing_description": "You can also trigger erasing manually (without considering the timeout defined above):", + "erase_unused_attachments_now": "Erase unused attachment notes now", + "unused_attachments_erased": "Unused attachments have been erased." + }, + "network_connections": { + "network_connections_title": "Network Connections", + "check_for_updates": "Check for updates automatically" + }, + "note_erasure_timeout": { + "note_erasure_timeout_title": "Note Erasure Timeout", + "note_erasure_description": "Deleted notes (and attributes, revisions...) are at first only marked as deleted and it is possible to recover them from Recent Notes dialog. After a period of time, deleted notes are \"erased\" which means their content is not recoverable anymore. This setting allows you to configure the length of the period between deleting and erasing the note.", + "erase_notes_after_x_seconds": "Erase notes after X seconds", + "manual_erasing_description": "You can also trigger erasing manually (without considering the timeout defined above):", + "erase_deleted_notes_now": "Erase deleted notes now", + "deleted_notes_erased": "Deleted notes have been erased." + }, + "revisions_snapshot_interval": { + "note_revisions_snapshot_interval_title": "Note Revisions Snapshot Interval", + "note_revisions_snapshot_description": "Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See wiki for more info.", + "snapshot_time_interval_label": "Note revision snapshot time interval (in seconds)" + }, + "search_engine": { + "title": "Search Engine", + "custom_search_engine_info": "Custom search engine requires both a name and a URL to be set. If either of these is not set, DuckDuckGo will be used as the default search engine.", + "predefined_templates_label": "Predefined search engine templates", + "bing": "Bing", + "baidu": "Baidu", + "duckduckgo": "DuckDuckGo", + "google": "Google", + "custom_name_label": "Custom search engine name", + "custom_name_placeholder": "Customize search engine name", + "custom_url_label": "Custom search engine URL should include {keyword} as a placeholder for the search term.", + "custom_url_placeholder": "Customize search engine url", + "save_button": "Save" + }, + "tray": { + "title": "Tray", + "enable_tray": "Enable tray (Trilium needs to be restarted for this change to take effect)" } }