From 3e73fe957e90cd5aa76a2f75f02b5d5b0bc79efd Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 25 Oct 2026 21:14:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(i18n):=20g-chords=20=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E9=9A=8F=E8=BD=A8=E5=89=8D=E7=BC=80=E5=8C=96?= =?UTF-8?q?=E2=80=94=E2=80=94en=20=E9=A1=B5=20g=20h=20=E8=B7=B3=20/en/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C 车道已知边界补刀:routes 表构建期按 locale 前缀化,en 页 g-chords 不再跳中文轨。 验证: playwright 双轨 g-chords 实跳(en g h→/en/、zh g g→ /gallery/);E2E 31/31 PASS Spec: none (五路由前缀化一行模式,C 车道边界补刀) Co-authored-by: GLM-5.3 --- src/components/geek/Keyboard.astro | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/geek/Keyboard.astro b/src/components/geek/Keyboard.astro index 79d5845..8d693b8 100644 --- a/src/components/geek/Keyboard.astro +++ b/src/components/geek/Keyboard.astro @@ -5,12 +5,14 @@ import { t } from '../../i18n/ui'; import { localeOf } from '../../lib/locale'; const locale = localeOf(Astro.url.pathname); +// g-chords 目标随轨前缀化(en 页 g h → /en/ 而非 /)——C 车道已知边界的补刀 +const pre = locale === 'en' ? '/en' : ''; const routes: Record = { - h: '/', - a: '/archives/', - g: '/gallery/', - m: '/moments/', - b: '/about/', + h: `${pre}/`, + a: `${pre}/archives/`, + g: `${pre}/gallery/`, + m: `${pre}/moments/`, + b: `${pre}/about/`, }; ---