From 4aa79fca065c6aa70fa8a8ce1bf62b2b383f661e Mon Sep 17 00:00:00 2001 From: wait4xx Date: Sun, 25 Oct 2026 09:26:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20UI=20=E5=AD=97=E5=85=B8=E4=B8=B2?= =?UTF-8?q?=E6=8E=A5=E4=B8=8E=E4=B8=89=E9=A1=B5=E8=96=84=E5=8C=96=E2=80=94?= =?UTF-8?q?=E2=80=94/en/=20=E5=85=A8=E7=AB=99=E8=90=BD=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - op-gitea 车道:ui.ts 扩 26 键(占位 {n}/{title}/{exif} 约定),五组件 locale prop 串接,zh 零回归(48 键/18 页实测) - orchestrator 收尾:gallery/moments/about 三页 body 提取为 components/pages/*Page(zh/en 薄页双路由),/en/ 全家福 21 页 - 提取工程三坑入库:HTML 注释不可进 frontmatter 模块区;搬移脚本会吃 开栏 ---;单级页面搬二级目录后 import 全线差一层 验证: astro build 21 页 exit 0;/en/ 七类路由产物断言过;en 页 ICP 备案保留;zh 侧文案抽查不变 Spec: 2026-10-25_add-blog-i18n Co-authored-by: GLM-5.3 --- .spec/specs/2026-10-25_add-blog-i18n/tasks.md | 2 +- src/components/Footer.astro | 10 +- src/components/SearchDialog.astro | 23 +- src/components/pages/AboutPage.astro | 122 ++++++ src/components/pages/GalleryPage.astro | 402 ++++++++++++++++++ src/components/pages/MomentsPage.astro | 150 +++++++ src/i18n/ui.ts | 36 ++ src/pages/about.astro | 118 +---- src/pages/en/about.astro | 4 + src/pages/en/gallery.astro | 4 + src/pages/en/moments.astro | 4 + src/pages/gallery/index.astro | 393 +---------------- src/pages/moments/index.astro | 142 +------ 13 files changed, 757 insertions(+), 653 deletions(-) create mode 100644 src/components/pages/AboutPage.astro create mode 100644 src/components/pages/GalleryPage.astro create mode 100644 src/components/pages/MomentsPage.astro create mode 100644 src/pages/en/about.astro create mode 100644 src/pages/en/gallery.astro create mode 100644 src/pages/en/moments.astro diff --git a/.spec/specs/2026-10-25_add-blog-i18n/tasks.md b/.spec/specs/2026-10-25_add-blog-i18n/tasks.md index f7b67a3..697d3e8 100644 --- a/.spec/specs/2026-10-25_add-blog-i18n/tasks.md +++ b/.spec/specs/2026-10-25_add-blog-i18n/tasks.md @@ -10,7 +10,7 @@ - boundary: 只改 astro.config.mjs(i18n 段)与 src/lib/locale.ts(当前语言工具) - verify: `pnpm astro build` -- [ ] T2 UI 字典 + 组件串接 +- [x] T2 UI 字典 + 组件串接 - depends-on: task_0001 - claim: op-gitea(mesh 车道,预约 src/i18n/ 与 Footer/SearchDialog/gallery/moments/about) - boundary: 新建 src/i18n/ui.ts(zh/en 字典)并串接 Footer/SearchDialog/gallery/moments/about 页的静态文案;不碰 Header/BaseLayout(orchestrator 的语言切换在那) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 9b53d13..ee27196 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,5 +1,13 @@ --- // 页脚:版权 + ICP 备案(法定保留)+ 构建透明槽位(T7 built-from 填充) +import { t } from '../i18n/ui'; +import type { Locale } from '../lib/locale'; + +// /en/ 侧由 T4 薄页传 locale='en';zh 路由无人传参,默认 zh 零回归 +interface Props { + locale?: Locale; +} +const { locale = 'zh' } = Astro.props; ---