Merge pull request #448 from Nriver/feature/i18n-part4

Feature/i18n part4
This commit is contained in:
Elian Doran 2024-09-25 18:54:12 +03:00 committed by GitHub
commit 9220616bb5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 79 additions and 9 deletions

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import protectedSessionHolder from "../services/protected_session_holder.js"; import protectedSessionHolder from "../services/protected_session_holder.js";
import SpacedUpdate from "../services/spaced_update.js"; import SpacedUpdate from "../services/spaced_update.js";
@ -155,7 +156,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
getTypeWidget() { getTypeWidget() {
if (!this.typeWidgets[this.type]) { 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]; return this.typeWidgets[this.type];

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import protectedSessionHolder from "../services/protected_session_holder.js"; import protectedSessionHolder from "../services/protected_session_holder.js";
import server from "../services/server.js"; import server from "../services/server.js";
@ -27,7 +28,7 @@ const TPL = `
} }
</style> </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>`; </div>`;
export default class NoteTitleWidget extends NoteContextAwareWidget { export default class NoteTitleWidget extends NoteContextAwareWidget {

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import NoteListRenderer from "../services/note_list_renderer.js"; import NoteListRenderer from "../services/note_list_renderer.js";
@ -22,11 +23,11 @@ const TPL = `
</style> </style>
<div class="search-no-results alert alert-info"> <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>
<div class="search-not-executed-yet alert alert-info"> <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>
<div class="search-result-widget-content"> <div class="search-result-widget-content">

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import BasicWidget from "./basic_widget.js"; import BasicWidget from "./basic_widget.js";
import contextMenu from "../menus/context_menu.js"; import contextMenu from "../menus/context_menu.js";
import appContext from "../components/app_context.js"; import appContext from "../components/app_context.js";
@ -25,7 +26,7 @@ export default class SpacerWidget extends BasicWidget {
x: e.pageX, x: e.pageX,
y: e.pageY, y: e.pageY,
items: [ items: [
{title: "Configure Launchbar", command: "showLaunchBarSubtree", uiIcon: "bx bx-sidebar"} {title: t("spacer.configure_launchbar"), command: "showLaunchBarSubtree", uiIcon: "bx bx-sidebar"}
], ],
selectMenuItemHandler: ({command}) => { selectMenuItemHandler: ({command}) => {
appContext.triggerCommand(command); appContext.triggerCommand(command);

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
const TPL = ` const TPL = `
@ -9,7 +10,7 @@ const TPL = `
</style> </style>
<div class="sql-query-no-rows alert alert-info" style="display: none;"> <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>
<div class="sql-console-result-container"></div> <div class="sql-console-result-container"></div>

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js";
import server from "../services/server.js"; import server from "../services/server.js";
@ -33,7 +34,7 @@ const TPL = `
} }
</style> </style>
Tables: ${t('sql_table_schemas.tables')}:
<span class="sql-table-schemas"></span> <span class="sql-table-schemas"></span>
</div>`; </div>`;

View File

@ -408,7 +408,8 @@
"add_new_label": "添加新标签 <kbd data-command=\"addNewLabel\"></kbd>", "add_new_label": "添加新标签 <kbd data-command=\"addNewLabel\"></kbd>",
"add_new_relation": "添加新关系 <kbd data-command=\"addNewRelation\"></kbd>", "add_new_relation": "添加新关系 <kbd data-command=\"addNewRelation\"></kbd>",
"add_new_label_definition": "添加新标签定义", "add_new_label_definition": "添加新标签定义",
"add_new_relation_definition": "添加新关系定义" "add_new_relation_definition": "添加新关系定义",
"placeholder": "在此输入标签和关系"
}, },
"abstract_bulk_action": { "abstract_bulk_action": {
"remove_this_search_action": "删除此搜索操作" "remove_this_search_action": "删除此搜索操作"
@ -659,6 +660,9 @@
"hide_floating_buttons_button": { "hide_floating_buttons_button": {
"button_title": "隐藏按钮" "button_title": "隐藏按钮"
}, },
"show_floating_buttons_button": {
"button_title": "显示按钮"
},
"svg_export_button": { "svg_export_button": {
"button_title": "导出SVG格式图片" "button_title": "导出SVG格式图片"
}, },
@ -680,7 +684,10 @@
"error_unrecognized_command": "无法识别的命令 {{command}}" "error_unrecognized_command": "无法识别的命令 {{command}}"
}, },
"note_icon": { "note_icon": {
"change_note_icon": "更改笔记图标" "change_note_icon": "更改笔记图标",
"category": "类别:",
"search": "搜索:",
"reset-default": "重置为默认图标"
}, },
"basic_properties": { "basic_properties": {
"note_type": "笔记类型", "note_type": "笔记类型",
@ -1346,5 +1353,43 @@
}, },
"mermaid": { "mermaid": {
"diagram_error": "图表无法显示。 请参考 <a href=\"https://mermaid-js.github.io/mermaid/#/flowchart?id=graph\">帮助文档和示例</a>。" "diagram_error": "图表无法显示。 请参考 <a href=\"https://mermaid-js.github.io/mermaid/#/flowchart?id=graph\">帮助文档和示例</a>。"
},
"quick-search": {
"placeholder": "快速搜索",
"searching": "正在搜索...",
"no-results": "未找到结果",
"more-results": "... 以及另外 {{number}} 个结果。",
"show-in-full-search": "在完整的搜索界面中显示"
},
"note_tree": {
"collapse-title": "折叠笔记树",
"scroll-active-title": "滚动到活动笔记",
"tree-settings-title": "树设置",
"hide-archived-notes": "隐藏已归档笔记",
"automatically-collapse-notes": "自动折叠笔记",
"automatically-collapse-notes-title": "笔记在一段时间内未使用将被折叠,以减少树形结构的杂乱。",
"save-changes": "保存并应用更改"
},
"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": "表"
} }
} }

View File

@ -1372,5 +1372,24 @@
}, },
"title_bar_buttons": { "title_bar_buttons": {
"window-on-top": "Keep this window on top." "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"
} }
} }