Skip to content

fix(i18n): localize UI copy and trim dev-only dependencies - #746

Open
markd3ng wants to merge 1 commit into
CuteLeaf:masterfrom
markd3ng:ff/documentation-lean
Open

markd3ng wants to merge 1 commit into
CuteLeaf:masterfrom
markd3ng:ff/documentation-lean

Conversation

@markd3ng

@markd3ng markd3ng commented Nov 29, 2026 •

Copy link
Copy Markdown

Summary

  • FF-25: move hard-coded user-facing copy into the existing i18n catalog (7 locales): navigation/menu aria-labels, tab label, share-poster labels, footer rights text, and banner image alt text. Consumers now call i18n(...) instead of embedding English strings.
  • FF-22: remove the 600 weight from Zen Maru Gothic, which has no 600-weight font file.
  • FF-30: move build/type-check-only packages (@astrojs/check, @types/hast, @types/mdast, tsx, typescript) from dependencies to devDependencies, with the lockfile importer mirrored.
  • FF-45: delete the unreferenced legacy plantuml-render-script.js (theme switching and pan/zoom are provided by the active plugins), and move encoded-email link styles into the global stylesheet because the plugin's <head> injection is unreachable for content fragments.

Scope notes

  • FF-23 (per-language translation chunks): deferred. All seven locale modules are statically imported by translation.ts; splitting them requires a different synchronous lookup or build-time substitution contract and is a larger architectural change than this cleanup.
  • FF-24 (public/pio size): no code change. The existing scripts/prune-pio-assets.ts already removes unused model assets after build; further reduction is a content/product decision.

Verification

  • pnpm exec biome check on all 17 changed source files: no diagnostics (only the pre-existing biome schema-version notice).
  • pnpm run check: 0 errors, 0 warnings, 0 hints.
  • pnpm exec astro build --force: 40 pages built.
  • Locale parity: each of the 7 locale modules defines all 10 new keys.
  • Built HTML contains localized aria-label/alt values and the localized footer string; built CSS contains a[data-encoded-email] rules.

Sourcery 总结

本地化剩余的用户界面文案,修正字体配置,精简开发依赖,并移除过时的插件代码。

错误修复:

  • 在全部七种受支持的语言中,为此前硬编码的导航、无障碍功能、分享、页脚和横幅文案添加本地化。
  • 移除不可用的 Zen Maru Gothic 600 字重。
  • 确保在没有文档头部的内容片段中,经过编码的电子邮件链接仍保留其样式。

功能增强:

  • 移除未使用的旧版 PlantUML 渲染脚本。

构建:

  • 将仅用于构建和类型检查的包从生产依赖移至开发依赖,并同步锁文件。
Original summary in English

Summary by Sourcery

Localize remaining user-facing UI copy, correct font configuration, streamline development dependencies, and remove obsolete plugin code.

Bug Fixes:

  • Localize previously hard-coded navigation, accessibility, sharing, footer, and banner text across all seven supported locales.
  • Remove the unavailable Zen Maru Gothic 600 font weight.
  • Ensure encoded-email links retain their styling in content fragments without a document head.

Enhancements:

  • Remove the unused legacy PlantUML rendering script.

Build:

  • Move build- and type-check-only packages from production dependencies to development dependencies and synchronize the lockfile.

- FF-25: move hard-coded aria-labels, footer and banner copy into all 7 locale modules
- FF-22: drop unsupported Zen Maru Gothic 600 weight
- FF-30: move check/types/tsx/typescript to devDependencies and mirror in lockfile
- FF-45: delete unreferenced plantuml render script and move encoded-email styles to global CSS
@netlify

netlify Bot commented Nov 29, 2026

Copy link
Copy Markdown

👷 Deploy request for demo-firefly pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1cf5864

@sourcery-ai

sourcery-ai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

审阅者指南

数据结构

添加十个共享的 UI 和无障碍功能键,并在全部七个语言目录中定义对应译文。

  • src/i18n/i18nKey.ts L526-537
  • src/i18n/languages/en.ts L545-556
  • src/i18n/languages/es.ts L546-557
  • src/i18n/languages/ja.ts L542-553
  • src/i18n/languages/ko.ts L542-553
  • src/i18n/languages/ru.ts L546-557
  • src/i18n/languages/zh_CN.ts L532-543
  • src/i18n/languages/zh_TW.ts L534-545

实现

删除已弃用的 PlantUML 渲染脚本,并移除电子邮件保护插件中无法执行到的 head 样式注入代码。

  • src/plugins/plantuml-render-script.js(已删除)
  • src/plugins/rehype-email-protection.mjs L55(已删除的代码行)、L67(已删除的代码行)、L102(已删除的代码行)

界面

导航、选项卡、页脚文案、分享海报标签和横幅图片替代文本均使用新的本地化字符串。

  • src/components/common/TabNav.svelte L3-4, L53
  • src/components/layout/Footer.astro L5-6, L46
  • src/components/layout/NavMenuPanel.astro L4-5, L22-25
  • src/components/layout/Navbar.astro L225, L231
  • src/components/layout/WallpaperSection.astro L8-174(9 处小改动)
  • src/components/misc/SharePoster.svelte L627, L644

将编码邮箱链接的样式移至全局样式表,使其也能应用于不含 head 元素的内容片段。

  • src/styles/main.css L684-694

配置

将仅用于构建和类型检查的包移至 devDependencies,并移除无法获取的 Zen Maru Gothic 600 字重。

  • package.json L28-112(6 处小改动)
  • src/config/fontConfig.ts L34

锁文件和供应商代码

更新生成的锁文件,使其与 package.json 中的依赖项调整保持一致。

  • pnpm-lock.yaml L411-416, L435-440(另有 4 处小改动)

提示和命令

与 Sourcery 交互

  • 触发新一轮审阅: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审阅评论。
  • 根据审阅评论创建 GitHub issue: 回复审阅评论,让 Sourcery 根据该评论创建 issue。你也可以在审阅评论中回复 @sourcery-ai issue 来创建 issue。
  • 生成拉取请求标题: 在拉取请求标题中的任意位置输入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时生成或重新生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中你希望显示摘要的位置输入 @sourcery-ai summary,即可随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时生成或重新生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时生成或重新生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已经处理完所有评论,不想再看到它们,这个功能会很有用。
  • 驳回所有 Sourcery 审阅: 在拉取请求中评论 @sourcery-ai dismiss,即可驳回所有现有的 Sourcery 审阅。如果你想从头开始新一轮审阅,这个功能尤其有用——别忘了评论 @sourcery-ai review 来触发新一轮审阅!

自定义使用体验

访问你的控制面板,即可:

  • 启用或停用审阅功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审阅语言。
  • 添加、删除或编辑自定义审阅说明。
  • 调整其他审阅设置。

获取帮助

Original review guide in English

Reviewer's Guide

Data structures

Add the ten shared UI and accessibility keys and define their translations in all seven locale catalogs.

  • src/i18n/i18nKey.ts L526-537
  • src/i18n/languages/en.ts L545-556
  • src/i18n/languages/es.ts L546-557
  • src/i18n/languages/ja.ts L542-553
  • src/i18n/languages/ko.ts L542-553
  • src/i18n/languages/ru.ts L546-557
  • src/i18n/languages/zh_CN.ts L532-543
  • src/i18n/languages/zh_TW.ts L534-545

Implementation

Remove the obsolete PlantUML rendering script and remove the unreachable head-style injection from the email-protection plugin.

  • src/plugins/plantuml-render-script.js (deleted)
  • src/plugins/rehype-email-protection.mjs L55 (removed lines), L67 (removed lines), L102 (removed lines)

UI

Use the new localized strings for navigation, tabs, footer copy, share-poster labels, and banner image alt text.

  • src/components/common/TabNav.svelte L3-4, L53
  • src/components/layout/Footer.astro L5-6, L46
  • src/components/layout/NavMenuPanel.astro L4-5, L22-25
  • src/components/layout/Navbar.astro L225, L231
  • src/components/layout/WallpaperSection.astro L8-174 (9 small edits)
  • src/components/misc/SharePoster.svelte L627, L644

Move encoded-email link styling to the global stylesheet so it applies to content fragments without a head element.

  • src/styles/main.css L684-694

Configuration

Move build and type-check-only packages to devDependencies and remove the unavailable Zen Maru Gothic 600 weight.

  • package.json L28-112 (6 small edits)
  • src/config/fontConfig.ts L34

Lock files and vendored code

Update the generated lockfile to mirror the dependency moves in package.json.

  • pnpm-lock.yaml L411-416, L435-440 (+4 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我已审阅你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 为开源项目免费提供服务——如果你喜欢我们的评审,欢迎分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant