add translation for 2 widgets

This commit is contained in:
Nriver 2024-09-13 11:10:59 +08:00
parent 87de631af4
commit 83388ecf1c
4 changed files with 30 additions and 12 deletions

View File

@ -3,6 +3,7 @@
* https://github.com/antoniotejada/Trilium-FindWidget * https://github.com/antoniotejada/Trilium-FindWidget
*/ */
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import FindInText from "./find_in_text.js"; import FindInText from "./find_in_text.js";
import FindInCode from "./find_in_code.js"; import FindInCode from "./find_in_code.js";
@ -53,12 +54,12 @@ const TPL = `
<div class="form-check"> <div class="form-check">
<input type="checkbox" class="form-check-input find-widget-case-sensitive-checkbox"> <input type="checkbox" class="form-check-input find-widget-case-sensitive-checkbox">
<label tabIndex="-1" class="form-check-label">case sensitive</label> <label tabIndex="-1" class="form-check-label">${t('find.case_sensitive')}</label>
</div> </div>
<div class="form-check"> <div class="form-check">
<input type="checkbox" class="form-check-input find-widget-match-words-checkbox"> <input type="checkbox" class="form-check-input find-widget-match-words-checkbox">
<label tabIndex="-1" class="form-check-label">match words</label> <label tabIndex="-1" class="form-check-label">${t('find.match_words')}</label>
</div> </div>
<div class="find-widget-found-wrapper"> <div class="find-widget-found-wrapper">

View File

@ -5,6 +5,7 @@
* - For example, if there is a formula in the middle of the highlighted text, the two ends of the formula will be regarded as two entries * - For example, if there is a formula in the middle of the highlighted text, the two ends of the formula will be regarded as two entries
*/ */
import { t } from "../services/i18n.js";
import attributeService from "../services/attributes.js"; import attributeService from "../services/attributes.js";
import RightPanelWidget from "./right_panel_widget.js"; import RightPanelWidget from "./right_panel_widget.js";
import options from "../services/options.js"; import options from "../services/options.js";
@ -43,14 +44,14 @@ const TPL = `<div class="highlights-list-widget">
export default class HighlightsListWidget extends RightPanelWidget { export default class HighlightsListWidget extends RightPanelWidget {
get widgetTitle() { get widgetTitle() {
return "Highlights List"; return t("highlights_list_2.title");
} }
get widgetButtons() { get widgetButtons() {
return [ return [
new OnClickButtonWidget() new OnClickButtonWidget()
.icon("bx-cog") .icon("bx-cog")
.title("Options") .title(t("highlights_list_2.options"))
.titlePlacement("left") .titlePlacement("left")
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', { activate: true })) .onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', { activate: true }))
.class("icon-action"), .class("icon-action"),

View File

@ -1335,5 +1335,13 @@
"toggle-on-hint": "将此笔记设为模板", "toggle-on-hint": "将此笔记设为模板",
"toggle-off-hint": "取消笔记模板设置" "toggle-off-hint": "取消笔记模板设置"
}, },
"open-help-page": "打开帮助页面" "open-help-page": "打开帮助页面",
"find": {
"case_sensitive": "区分大小写",
"match_words": "匹配单词"
},
"highlights_list_2": {
"title": "高亮列表",
"options": "选项"
}
} }

View File

@ -602,10 +602,10 @@
"sync_status": { "sync_status": {
"unknown": "<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>", "unknown": "<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>",
"connected_with_changes": "<p>Connected to the sync server. <br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>", "connected_with_changes": "<p>Connected to the sync server. <br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>",
"connected_no_changes":"<p>Connected to the sync server.<br>All changes have been already synced.</p><p>Click to trigger sync.</p>", "connected_no_changes": "<p>Connected to the sync server.<br>All changes have been already synced.</p><p>Click to trigger sync.</p>",
"disconnected_with_changes":"<p>Establishing the connection to the sync server was unsuccessful.<br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>", "disconnected_with_changes": "<p>Establishing the connection to the sync server was unsuccessful.<br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>",
"disconnected_no_changes":"<p>Establishing the connection to the sync server was unsuccessful.<br>All known changes have been synced.</p><p>Click to trigger sync.</p>", "disconnected_no_changes": "<p>Establishing the connection to the sync server was unsuccessful.<br>All known changes have been synced.</p><p>Click to trigger sync.</p>",
"in_progress":"Sync with the server is in progress." "in_progress": "Sync with the server is in progress."
}, },
"left_pane_toggle": { "left_pane_toggle": {
"show_panel": "Show panel", "show_panel": "Show panel",
@ -1335,5 +1335,13 @@
"toggle-on-hint": "Make the note a template", "toggle-on-hint": "Make the note a template",
"toggle-off-hint": "Remove the note as a template" "toggle-off-hint": "Remove the note as a template"
}, },
"open-help-page": "Open help page" "open-help-page": "Open help page",
"find": {
"case_sensitive": "case sensitive",
"match_words": "match words"
},
"highlights_list_2": {
"title": "Highlights List",
"options": "Options"
}
} }