add translation for tab_row.js

This commit is contained in:
Nriver 2024-10-15 14:51:26 +08:00
parent 83dbe0539e
commit 858db68d66
3 changed files with 27 additions and 8 deletions

View File

@ -1,3 +1,4 @@
import { t } from "../services/i18n.js";
import BasicWidget from "./basic_widget.js";
import contextMenu from "../menus/context_menu.js";
import utils from "../services/utils.js";
@ -37,11 +38,11 @@ const TAB_TPL = `
<div class="note-tab-drag-handle"></div>
<div class="note-tab-icon"></div>
<div class="note-tab-title"></div>
<div class="note-tab-close bx bx-x" title="Close tab" data-trigger-command="closeActiveTab"></div>
<div class="note-tab-close bx bx-x" title="${t('tab_row.close_tab')}" data-trigger-command="closeActiveTab"></div>
</div>
</div>`;
const NEW_TAB_BUTTON_TPL = `<div class="note-new-tab" data-trigger-command="openNewTab" title="Add new tab">+</div>`;
const NEW_TAB_BUTTON_TPL = `<div class="note-new-tab" data-trigger-command="openNewTab" title="${t('tab_row.add_new_tab')}">+</div>`;
const FILLER_TPL = `<div class="tab-row-filler"></div>`;
const TAB_ROW_TPL = `
@ -258,10 +259,10 @@ export default class TabRowWidget extends BasicWidget {
x: e.pageX,
y: e.pageY,
items: [
{title: "Close", command: "closeTab", uiIcon: "bx bx-x"},
{title: "Close other tabs", command: "closeOtherTabs", uiIcon: "bx bx-x"},
{title: "Close all tabs", command: "closeAllTabs", uiIcon: "bx bx-x"},
{title: "Move this tab to a new window", command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"}
{title: t('tab_row.close'), command: "closeTab", uiIcon: "bx bx-x"},
{title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-x"},
{title: t('tab_row.close_all_tabs'), command: "closeAllTabs", uiIcon: "bx bx-x"},
{title: t('tab_row.move_tab_to_new_window'), command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"}
],
selectMenuItemHandler: ({command}) => {
this.triggerCommand(command, {ntxId});
@ -387,7 +388,7 @@ export default class TabRowWidget extends BasicWidget {
this.$newTab.before($tab);
this.setVisibility();
this.setTabCloseEvent($tab);
this.updateTitle($tab, 'New tab');
this.updateTitle($tab, t('tab_row.new_tab'));
this.cleanUpPreviouslyDraggedTabs();
this.layoutTabs();
this.setupDraggabilly();
@ -672,7 +673,7 @@ export default class TabRowWidget extends BasicWidget {
const {note} = noteContext;
if (!note) {
this.updateTitle($tab, 'New tab');
this.updateTitle($tab, t('tab_row.new_tab'));
return;
}

View File

@ -1391,5 +1391,14 @@
},
"sql_table_schemas": {
"tables": "表"
},
"tab_row": {
"close_tab": "关闭标签页",
"add_new_tab": "添加新标签页",
"close": "关闭",
"close_other_tabs": "关闭其他标签页",
"close_all_tabs": "关闭所有标签页",
"move_tab_to_new_window": "将此标签页移动到新窗口",
"new_tab": "新标签页"
}
}

View File

@ -1401,5 +1401,14 @@
},
"sql_table_schemas": {
"tables": "Tables"
},
"tab_row": {
"close_tab": "Close tab",
"add_new_tab": "Add new tab",
"close": "Close",
"close_other_tabs": "Close other tabs",
"close_all_tabs": "Close all tabs",
"move_tab_to_new_window": "Move this tab to a new window",
"new_tab": "New tab"
}
}