From 858db68d661c0fdf1448d5ae02d63206d0ba56a1 Mon Sep 17 00:00:00 2001
From: Nriver <6752679+Nriver@users.noreply.github.com>
Date: Tue, 15 Oct 2024 14:51:26 +0800
Subject: [PATCH] add translation for tab_row.js
---
src/public/app/widgets/tab_row.js | 17 +++++++++--------
src/public/translations/cn/translation.json | 9 +++++++++
src/public/translations/en/translation.json | 9 +++++++++
3 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js
index e47a1ee33..395dd51d5 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 = `
-
+
`;
-const NEW_TAB_BUTTON_TPL = `+
`;
+const NEW_TAB_BUTTON_TPL = `+
`;
const FILLER_TPL = ``;
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 99b082f34..d30b45937 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 965f0d2f5..88f3b7345 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"
}
}