fix(i18n): g-chords 导航目标随轨前缀化——en 页 g h 跳 /en/
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
This commit is contained in:
1 parent
810cf44d3d
commit
3e73fe957e
1 file changed
+7
-5
@@ -5,12 +5,14 @@
|
|||||||
import { t } from '../../i18n/ui';
|
import { t } from '../../i18n/ui';
|
||||||
import { localeOf } from '../../lib/locale';
|
import { localeOf } from '../../lib/locale';
|
||||||
const locale = localeOf(Astro.url.pathname);
|
const locale = localeOf(Astro.url.pathname);
|
||||||
|
// g-chords 目标随轨前缀化(en 页 g h → /en/ 而非 /)——C 车道已知边界的补刀
|
||||||
|
const pre = locale === 'en' ? '/en' : '';
|
||||||
const routes: Record<string, string> = {
|
const routes: Record<string, string> = {
|
||||||
h: '/',
|
h: `${pre}/`,
|
||||||
a: '/archives/',
|
a: `${pre}/archives/`,
|
||||||
g: '/gallery/',
|
g: `${pre}/gallery/`,
|
||||||
m: '/moments/',
|
m: `${pre}/moments/`,
|
||||||
b: '/about/',
|
b: `${pre}/about/`,
|
||||||
};
|
};
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user