From 0c569b0b312ea90c23a444fe00b85d587a963683 Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 25 Oct 2026 21:12:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20Keyboard=20=E5=B8=AE=E5=8A=A9?= =?UTF-8?q?=E8=A1=A8=E5=85=A8=E9=87=8F=E5=8F=8C=E8=AF=AD=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=9C=9F=20localeOf=20=E8=87=AA=E6=8E=A8?= =?UTF-8?q?=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 10 词条+标题+hint 全走 t(key, locale)(ui.ts 新增 kbd_* 11 键, 零文案字面量复制);en/terminal 车道的运行时 replaceChildren 补丁退役(构建期已渲染正确文案) - hint 行精简:删过程性标注"Phase 4 上线 ~"(~ 并非实际绑定, 有误导),改 /terminal 彩蛋引导语 - 已知边界另车道:g-chords 路由表仍 zh 路径(en 页 g h 跳 / 而非 /en/)——routes 表 locale 化待办 车道:op-artalk(自验 7/7:zh/en 深层路由自感知/inField 旁路 (?正常入框不弹层)/blur 回归);收编验收 dialog 作用域复验全过 (首验 2 FAIL 均系验收方断言姿势:大小写+全 body 作用域,非车道 缺陷——验收先探实值再断言的教训第三次入档) 验证: pnpm astro build 34 页 exit 0;E2E 31/31 PASS;en 深层路由 /en/terminal/ 帮助表纯英文实测 Spec: none (组件双语化,车道级交付) Co-authored-by: GLM-5.3 --- src/components/geek/Keyboard.astro | 30 +++++++++++++++--------------- src/i18n/ui.ts | 13 +++++++++++++ 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/components/geek/Keyboard.astro b/src/components/geek/Keyboard.astro index 2868976..79d5845 100644 --- a/src/components/geek/Keyboard.astro +++ b/src/components/geek/Keyboard.astro @@ -1,6 +1,10 @@ --- // 键盘层(极客层 P0):? 帮助 / t 主题 / g-chords 导航 // 惯例来源:GitHub 键位(g+N、? 帮助);每项能力都有可视入口(触屏等价物原则) +// 文案全部 ui.ts 词条:locale 构建期按页面 URL 自推断(BaseLayout 不透传,同 Footer 模式) +import { t } from '../../i18n/ui'; +import { localeOf } from '../../lib/locale'; +const locale = localeOf(Astro.url.pathname); const routes: Record = { h: '/', a: '/archives/', @@ -11,21 +15,21 @@ const routes: Record = { --- -

键盘快捷键

+

{t('kbd_title', locale)}

- - - - - - - - - + + + + + + + + +
Ctrl K命令面板
t切换明暗
?本帮助
g h首页
g a文章
g g图库
g m瞬间
/terminal终端彩蛋
Esc关闭浮层
Ctrl K{t('kbd_palette', locale)}
t{t('kbd_theme_toggle', locale)}
?{t('kbd_this_help', locale)}
g h{t('kbd_gh_home', locale)}
g a{t('kbd_ga_posts', locale)}
g g{t('kbd_gg_gallery', locale)}
g m{t('kbd_gm_moments', locale)}
/terminal{t('kbd_terminal', locale)}
Esc{t('kbd_esc_close', locale)}
-

提示:试试终端彩蛋(Phase 4 上线 ~)

+

{t('kbd_hint', locale)}