Skip to content

Commit

Permalink
add translation for 2 widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
Nriver committed Sep 13, 2024
1 parent 87de631 commit 83388ec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
9 changes: 5 additions & 4 deletions src/public/app/widgets/find.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* https://github.com/antoniotejada/Trilium-FindWidget
*/

import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js";
import FindInText from "./find_in_text.js";
import FindInCode from "./find_in_code.js";
Expand Down Expand Up @@ -53,12 +54,12 @@ const TPL = `
<div class="form-check">
<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 class="form-check">
<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 class="find-widget-found-wrapper">
Expand Down Expand Up @@ -273,7 +274,7 @@ export default class FindWidget extends NoteContextAwareWidget {

async entitiesReloadedEvent({loadResults}) {
if (loadResults.isNoteContentReloaded(this.noteId)) {
this.$totalFound.text("?")
}
this.$totalFound.text("?")
}
}
}
5 changes: 3 additions & 2 deletions src/public/app/widgets/highlights_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/

import { t } from "../services/i18n.js";
import attributeService from "../services/attributes.js";
import RightPanelWidget from "./right_panel_widget.js";
import options from "../services/options.js";
Expand Down Expand Up @@ -43,14 +44,14 @@ const TPL = `<div class="highlights-list-widget">

export default class HighlightsListWidget extends RightPanelWidget {
get widgetTitle() {
return "Highlights List";
return t("highlights_list_2.title");
}

get widgetButtons() {
return [
new OnClickButtonWidget()
.icon("bx-cog")
.title("Options")
.title(t("highlights_list_2.options"))
.titlePlacement("left")
.onClick(() => appContext.tabManager.openContextWithNote('_optionsTextNotes', { activate: true }))
.class("icon-action"),
Expand Down
10 changes: 9 additions & 1 deletion src/public/translations/cn/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1335,5 +1335,13 @@
"toggle-on-hint": "将此笔记设为模板",
"toggle-off-hint": "取消笔记模板设置"
},
"open-help-page": "打开帮助页面"
"open-help-page": "打开帮助页面",
"find": {
"case_sensitive": "区分大小写",
"match_words": "匹配单词"
},
"highlights_list_2": {
"title": "高亮列表",
"options": "选项"
}
}
18 changes: 13 additions & 5 deletions src/public/translations/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,10 @@
"sync_status": {
"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_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_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."
"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_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."
},
"left_pane_toggle": {
"show_panel": "Show panel",
Expand Down Expand Up @@ -1335,5 +1335,13 @@
"toggle-on-hint": "Make the note 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"
}
}

0 comments on commit 83388ec

Please sign in to comment.