Skip to content

Build your personal knowledge base with Trilium Notes

add translation for tab_row.js

Nriver858db68d661c
diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js
index e47a1ee338..395dd51d51 100644
--- a/src/public/app/widgets/tab_row.js
+++ b/src/public/app/widgets/tab_row.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 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;
}
diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json
index 99b082f343..d30b459372 100644
--- a/src/public/translations/cn/translation.json
+++ b/src/public/translations/cn/translation.json
@@ -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": "新标签页"
}
}
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index 965f0d2f55..88f3b7345c 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -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"
}
}