add translation for all other options

This commit is contained in:
Nriver 2024-08-09 14:37:03 +08:00
parent f6f5cc2ecb
commit d6aa4d26dd
8 changed files with 123 additions and 34 deletions

View File

@ -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 = `
<div class="options-section">
<h4>Attachment Erasure Timeout</h4>
<h4>${t("attachment_erasure_timeout.attachment_erasure_timeout")}</h4>
<p>Attachments get automatically deleted (and erased) if they are not referenced by their note anymore after a defined time out.</p>
<p>${t("attachment_erasure_timeout.attachment_auto_deletion_description")}</p>
<div class="form-group">
<label>Erase attachments after X seconds of not being used in its note</label>
<label>${t("attachment_erasure_timeout.erase_attachments_after_x_seconds")}</label>
<input class="erase-unused-attachments-after-time-in-seconds form-control options-number-input" type="number" min="0">
</div>
<p>You can also trigger erasing manually (without considering the timeout defined above):</p>
<p>${t("attachment_erasure_timeout.manual_erasing_description")}</p>
<button class="erase-unused-attachments-now-button btn">Erase unused attachment notes now</button>
<button class="erase-unused-attachments-now-button btn">${t("attachment_erasure_timeout.erase_unused_attachments_now")}</button>
</div>`;
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"));
});
});
}

View File

@ -1,12 +1,13 @@
import OptionsWidget from "../options_widget.js";
import { t } from "../../../../services/i18n.js";
const TPL = `
<div class="options-section">
<h4>Network Connections</h4>
<h4>${t("network_connections.network_connections_title")}</h4>
<label>
<input class="check-for-updates" type="checkbox" name="check-for-updates">
Check for updates automatically
${t("network_connections.check_for_updates")}
</label>
</div>`;

View File

@ -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 = `
<div class="options-section">
<h4>Note Erasure Timeout</h4>
<h4>${t("note_erasure_timeout.note_erasure_timeout_title")}</h4>
<p>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.</p>
<p>${t("note_erasure_timeout.note_erasure_description")}</p>
<div class="form-group">
<label>Erase notes after X seconds</label>
<label>${t("note_erasure_timeout.erase_notes_after_x_seconds")}</label>
<input class="erase-entities-after-time-in-seconds form-control options-number-input" type="number" min="0">
</div>
<p>You can also trigger erasing manually (without considering the timeout defined above):</p>
<p>${t("note_erasure_timeout.manual_erasing_description")}</p>
<button class="erase-deleted-notes-now-button btn">Erase deleted notes now</button>
<button class="erase-deleted-notes-now-button btn">${t("note_erasure_timeout.erase_deleted_notes_now")}</button>
</div>`;
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"));
});
});
}

View File

@ -1,13 +1,14 @@
import OptionsWidget from "../options_widget.js";
import { t } from "../../../../services/i18n.js";
const TPL = `
<div class="options-section">
<h4>Note Revisions Snapshot Interval</h4>
<h4>${t("revisions_snapshot_interval.note_revisions_snapshot_interval_title")}</h4>
<p>Note revision snapshot time interval is time in seconds after which a new note revision will be created for the note. See <a href="https://github.com/TriliumNext/Docs/blob/main/Wiki/note-revisions.md" class="external">wiki</a> for more info.</p>
<p>${t("revisions_snapshot_interval.note_revisions_snapshot_description")}</p>
<div class="form-group">
<label>Note revision snapshot time interval (in seconds)</label>
<label>${t("revisions_snapshot_interval.snapshot_time_interval_label")}</label>
<input class="revision-snapshot-time-interval-in-seconds form-control options-number-input" type="number" min="10">
</div>
</div>`;

View File

@ -1,35 +1,36 @@
import OptionsWidget from "../options_widget.js";
import utils from "../../../../services/utils.js";
import { t } from "../../../../services/i18n.js";
const TPL = `
<div class="options-section">
<h4>Search Engine</h4>
<h4>${t("search_engine.title")}</h4>
<p>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.</p>
<p>${t("search_engine.custom_search_engine_info")}</p>
<form class="sync-setup-form">
<div class="form-group">
<label>Predefined search engine templates</label>
<label>${t("search_engine.predefined_templates_label")}</label>
<select class="predefined-search-engine-select form-control">
<option value="Bing">Bing</option>
<option value="Baidu">Baidu</option>
<option value="DuckDuckGo">Duckduckgo</option>
<option value="Google">Google</option>
<option value="Bing">${t("search_engine.bing")}</option>
<option value="Baidu">${t("search_engine.baidu")}</option>
<option value="DuckDuckGo">${t("search_engine.duckduckgo")}</option>
<option value="Google">${t("search_engine.google")}</option>
</select>
</div>
<div class="form-group">
<label>Custom search engine name</label>
<input type="text" class="custom-search-engine-name form-control" placeholder="Customize search engine name">
<label>${t("search_engine.custom_name_label")}</label>
<input type="text" class="custom-search-engine-name form-control" placeholder="${t("search_engine.custom_name_placeholder")}">
</div>
<div class="form-group">
<label>Custom search engine URL should include <code>{keyword}</code> as a placeholder for the search term.</label>
<input type="text" class="custom-search-engine-url form-control" placeholder="Customize search engine url">
<label>${t("search_engine.custom_url_label")}</label>
<input type="text" class="custom-search-engine-url form-control" placeholder="${t("search_engine.custom_url_placeholder")}">
</div>
<div style="display: flex; justify-content: space-between;">
<button class="btn btn-primary">Save</button>
<button class="btn btn-primary">${t("search_engine.save_button")}</button>
</div>
</form>
</div>`;

View File

@ -1,12 +1,13 @@
import OptionsWidget from "../options_widget.js";
import { t } from "../../../../services/i18n.js";
const TPL = `
<div class="options-section">
<h4>Tray</h4>
<h4>${t("tray.title")}</h4>
<label>
<input type="checkbox" class="tray-enabled">
Enable tray (Trilium needs to be restarted for this change to take effect)
${t("tray.enable_tray")}
</label>
</div>`;

View File

@ -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": "笔记修改快照时间间隔是指经过多少秒后会为笔记创建新的修改历史。更多信息请参见<a href=\"https://github.com/TriliumNext/Docs/blob/main/Wiki/note-revisions.md\" class=\"external\">wiki</a>。",
"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": "启用托盘图标(需要重启生效)"
}
}

View File

@ -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 <a href=\"https://github.com/TriliumNext/Docs/blob/main/Wiki/note-revisions.md\" class=\"external\">wiki</a> 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)"
}
}