mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 02:02:29 +08:00
add translation for tab_row.js
This commit is contained in:
parent
83dbe0539e
commit
858db68d66
@ -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 utils from "../services/utils.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-drag-handle"></div>
|
||||||
<div class="note-tab-icon"></div>
|
<div class="note-tab-icon"></div>
|
||||||
<div class="note-tab-title"></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>
|
||||||
</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 FILLER_TPL = `<div class="tab-row-filler"></div>`;
|
||||||
|
|
||||||
const TAB_ROW_TPL = `
|
const TAB_ROW_TPL = `
|
||||||
@ -258,10 +259,10 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
x: e.pageX,
|
x: e.pageX,
|
||||||
y: e.pageY,
|
y: e.pageY,
|
||||||
items: [
|
items: [
|
||||||
{title: "Close", command: "closeTab", uiIcon: "bx bx-x"},
|
{title: t('tab_row.close'), command: "closeTab", uiIcon: "bx bx-x"},
|
||||||
{title: "Close other tabs", command: "closeOtherTabs", uiIcon: "bx bx-x"},
|
{title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-x"},
|
||||||
{title: "Close all tabs", command: "closeAllTabs", uiIcon: "bx bx-x"},
|
{title: t('tab_row.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.move_tab_to_new_window'), command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"}
|
||||||
],
|
],
|
||||||
selectMenuItemHandler: ({command}) => {
|
selectMenuItemHandler: ({command}) => {
|
||||||
this.triggerCommand(command, {ntxId});
|
this.triggerCommand(command, {ntxId});
|
||||||
@ -387,7 +388,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
this.$newTab.before($tab);
|
this.$newTab.before($tab);
|
||||||
this.setVisibility();
|
this.setVisibility();
|
||||||
this.setTabCloseEvent($tab);
|
this.setTabCloseEvent($tab);
|
||||||
this.updateTitle($tab, 'New tab');
|
this.updateTitle($tab, t('tab_row.new_tab'));
|
||||||
this.cleanUpPreviouslyDraggedTabs();
|
this.cleanUpPreviouslyDraggedTabs();
|
||||||
this.layoutTabs();
|
this.layoutTabs();
|
||||||
this.setupDraggabilly();
|
this.setupDraggabilly();
|
||||||
@ -672,7 +673,7 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
const {note} = noteContext;
|
const {note} = noteContext;
|
||||||
|
|
||||||
if (!note) {
|
if (!note) {
|
||||||
this.updateTitle($tab, 'New tab');
|
this.updateTitle($tab, t('tab_row.new_tab'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1391,5 +1391,14 @@
|
|||||||
},
|
},
|
||||||
"sql_table_schemas": {
|
"sql_table_schemas": {
|
||||||
"tables": "表"
|
"tables": "表"
|
||||||
|
},
|
||||||
|
"tab_row": {
|
||||||
|
"close_tab": "关闭标签页",
|
||||||
|
"add_new_tab": "添加新标签页",
|
||||||
|
"close": "关闭",
|
||||||
|
"close_other_tabs": "关闭其他标签页",
|
||||||
|
"close_all_tabs": "关闭所有标签页",
|
||||||
|
"move_tab_to_new_window": "将此标签页移动到新窗口",
|
||||||
|
"new_tab": "新标签页"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1401,5 +1401,14 @@
|
|||||||
},
|
},
|
||||||
"sql_table_schemas": {
|
"sql_table_schemas": {
|
||||||
"tables": "Tables"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user