From 4d760d30198b0256943f2f813e535fdc232bb785 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com>
Date: Wed, 11 Dec 2024 18:45:45 +0800
Subject: [PATCH] feat: Some adjustments to internationalization (#7332)
---
frontend/src/layout/components/Sidebar/index.vue | 2 +-
frontend/src/routers/index.ts | 6 ++++++
frontend/src/views/setting/panel/index.vue | 3 ++-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/frontend/src/layout/components/Sidebar/index.vue b/frontend/src/layout/components/Sidebar/index.vue
index a56ff33a6..fa2c235b8 100644
--- a/frontend/src/layout/components/Sidebar/index.vue
+++ b/frontend/src/layout/components/Sidebar/index.vue
@@ -133,7 +133,7 @@ function getCheckedLabels(json: Node): string[] {
const search = async () => {
await checkIsSystemIntl();
- let checkedLabels: string | any[];
+ let checkedLabels: any[] = [];
if (!globalStore.isIntl) {
const res = await getSettingInfo();
const json: Node = JSON.parse(res.data.xpackHideMenu);
diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts
index 6959fec84..04a935bf4 100644
--- a/frontend/src/routers/index.ts
+++ b/frontend/src/routers/index.ts
@@ -10,6 +10,12 @@ router.beforeEach((to, from, next) => {
axiosCanceler.removeAllPending();
const globalStore = GlobalStore();
+ if (globalStore.isIntl && to.path.includes('xpack')) {
+ next({ name: '404' });
+ NProgress.done();
+ return;
+ }
+
if (to.name !== 'entrance' && !globalStore.isLogin) {
next({
name: 'entrance',
diff --git a/frontend/src/views/setting/panel/index.vue b/frontend/src/views/setting/panel/index.vue
index d3ad848d7..0a5ce9a79 100644
--- a/frontend/src/views/setting/panel/index.vue
+++ b/frontend/src/views/setting/panel/index.vue
@@ -77,9 +77,10 @@
@change="onSave('Language', form.language)"
v-model="form.language"
>
+ English
中文(简体)
中文(繁體)
- English
+ English