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 6 widgets
Nrivereb9b4aee21ea
diff --git a/src/public/app/widgets/note_detail.js b/src/public/app/widgets/note_detail.jsindex 91aa9998ed..19544b7cb2 100644--- a/src/public/app/widgets/note_detail.js+++ b/src/public/app/widgets/note_detail.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import NoteContextAwareWidget from "./note_context_aware_widget.js";import protectedSessionHolder from "../services/protected_session_holder.js";import SpacedUpdate from "../services/spaced_update.js";@@ -155,7 +156,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {getTypeWidget() {if (!this.typeWidgets[this.type]) {- throw new Error(`Could not find typeWidget for type '${this.type}'`);+ throw new Error(t(`note_detail.could_not_find_typewidget`, { type: this.type }));}return this.typeWidgets[this.type];diff --git a/src/public/app/widgets/note_title.js b/src/public/app/widgets/note_title.jsindex 14fcff9ae3..7164e3aa1d 100644--- a/src/public/app/widgets/note_title.js+++ b/src/public/app/widgets/note_title.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import NoteContextAwareWidget from "./note_context_aware_widget.js";import protectedSessionHolder from "../services/protected_session_holder.js";import server from "../services/server.js";@@ -27,7 +28,7 @@ const TPL = `}</style>- <input autocomplete="off" value="" placeholder="type note's title here..." class="note-title" tabindex="100">+ <input autocomplete="off" value="" placeholder="${t('note_title.placeholder')}" class="note-title" tabindex="100"></div>`;export default class NoteTitleWidget extends NoteContextAwareWidget {diff --git a/src/public/app/widgets/search_result.js b/src/public/app/widgets/search_result.jsindex 159702f6e7..390ecdae83 100644--- a/src/public/app/widgets/search_result.js+++ b/src/public/app/widgets/search_result.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import NoteContextAwareWidget from "./note_context_aware_widget.js";import NoteListRenderer from "../services/note_list_renderer.js";@@ -22,11 +23,11 @@ const TPL = `</style><div class="search-no-results alert alert-info">- No notes have been found for given search parameters.+ ${t('search_result.no_notes_found')}</div><div class="search-not-executed-yet alert alert-info">- Search has not been executed yet. Click on "Search" button above to see the results.+ ${t('search_result.search_not_executed')}</div><div class="search-result-widget-content">diff --git a/src/public/app/widgets/spacer.js b/src/public/app/widgets/spacer.jsindex 0d6c6a8ec7..396cec5989 100644--- a/src/public/app/widgets/spacer.js+++ b/src/public/app/widgets/spacer.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import BasicWidget from "./basic_widget.js";import contextMenu from "../menus/context_menu.js";import appContext from "../components/app_context.js";@@ -25,7 +26,7 @@ export default class SpacerWidget extends BasicWidget {x: e.pageX,y: e.pageY,items: [- {title: "Configure Launchbar", command: "showLaunchBarSubtree", uiIcon: "bx bx-sidebar"}+ {title: t("spacer.configure_launchbar"), command: "showLaunchBarSubtree", uiIcon: "bx bx-sidebar"}],selectMenuItemHandler: ({command}) => {appContext.triggerCommand(command);diff --git a/src/public/app/widgets/sql_result.js b/src/public/app/widgets/sql_result.jsindex 4224e714b6..f2842ff05e 100644--- a/src/public/app/widgets/sql_result.js+++ b/src/public/app/widgets/sql_result.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import NoteContextAwareWidget from "./note_context_aware_widget.js";const TPL = `@@ -9,7 +10,7 @@ const TPL = `</style><div class="sql-query-no-rows alert alert-info" style="display: none;">- No rows have been returned for this query.+ ${t('sql_result.no_rows')}</div><div class="sql-console-result-container"></div>diff --git a/src/public/app/widgets/sql_table_schemas.js b/src/public/app/widgets/sql_table_schemas.jsindex 5764636b5f..61f988b7dc 100644--- a/src/public/app/widgets/sql_table_schemas.js+++ b/src/public/app/widgets/sql_table_schemas.js@@ -1,3 +1,4 @@+import { t } from "../services/i18n.js";import NoteContextAwareWidget from "./note_context_aware_widget.js";import server from "../services/server.js";@@ -33,7 +34,7 @@ const TPL = `}</style>- Tables:+ ${t('sql_table_schemas.tables')}:<span class="sql-table-schemas"></span></div>`;diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.jsonindex 6818e22141..3ecbc25458 100644--- a/src/public/translations/cn/translation.json+++ b/src/public/translations/cn/translation.json@@ -1372,5 +1372,24 @@},"title_bar_buttons": {"window-on-top": "保持此窗口置顶"+ },+ "note_detail": {+ "could_not_find_typewidget": "找不到类型为 '{{type}}' 的 typeWidget"+ },+ "note_title": {+ "placeholder": "请输入笔记标题..."+ },+ "search_result": {+ "no_notes_found": "没有找到符合搜索条件的笔记。",+ "search_not_executed": "尚未执行搜索。请点击上方的\"搜索\"按钮查看结果。"+ },+ "spacer": {+ "configure_launchbar": "配置启动栏"+ },+ "sql_result": {+ "no_rows": "此查询没有返回任何数据"+ },+ "sql_table_schemas": {+ "tables": "表"}}diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex b8855153b0..faf0a4fe91 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -1372,5 +1372,24 @@},"title_bar_buttons": {"window-on-top": "Keep this window on top."+ },+ "note_detail": {+ "could_not_find_typewidget": "Could not find typeWidget for type '{{type}}'"+ },+ "note_title": {+ "placeholder": "type note's title here..."+ },+ "search_result": {+ "no_notes_found": "No notes have been found for given search parameters.",+ "search_not_executed": "Search has not been executed yet. Click on \"Search\" button above to see the results."+ },+ "spacer": {+ "configure_launchbar": "Configure Launchbar"+ },+ "sql_result": {+ "no_rows": "No rows have been returned for this query"+ },+ "sql_table_schemas": {+ "tables": "Tables"}}