From e1715b9f18507a43224f78b80c9617a33de4b539 Mon Sep 17 00:00:00 2001 From: shijun Date: Tue, 7 Jul 2026 11:15:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor(web):=20=E4=BD=BF=E7=94=A8=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E5=87=BD=E6=95=B0=E4=B8=BA=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E5=92=8C=E9=9D=A2=E5=8C=85=E5=B1=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 引入i18n模块以支持多语言翻译 - 在getPageTitle中使用i18n的t方法翻译格式化后的标题 - 在布局头部组件中将面包屑标题文本改为通过t方法翻译 - 保持原有标题格式和结构不变,增强国际化兼容性 --- web/src/utils/page.js | 3 ++- web/src/view/layout/header/index.vue | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/utils/page.js b/web/src/utils/page.js index 6a3c6d843..dc78b0119 100644 --- a/web/src/utils/page.js +++ b/web/src/utils/page.js @@ -1,8 +1,9 @@ import { fmtTitle } from '@/utils/fmtRouterTitle' import config from '@/core/config' +import i18n from '@/i18n' export default function getPageTitle(pageTitle, route) { if (pageTitle) { - const title = fmtTitle(pageTitle, route) + const title = i18n.global.t(fmtTitle(pageTitle, route)) return `${title} - ${config.appName}` } return `${config.appName}` diff --git a/web/src/view/layout/header/index.vue b/web/src/view/layout/header/index.vue index ca92da404..d256a7442 100644 --- a/web/src/view/layout/header/index.vue +++ b/web/src/view/layout/header/index.vue @@ -40,7 +40,7 @@ v-for="item in matched.slice(1, matched.length)" :key="item.path" > - {{ fmtTitle(item.meta.title, route) }} + {{ t(fmtTitle(item.meta.title, route)) }}