Skip to content

fix(docs): 修回 33 篇中文文档被机翻毁掉的 title - #396

Merged
longsizhuo merged 1 commit into
mainfrom
fix/zh-doc-titles
Aug 3, 2026
Merged

fix(docs): 修回 33 篇中文文档被机翻毁掉的 title#396
longsizhuo merged 1 commit into
mainfrom
fix/zh-doc-titles

Conversation

@longsizhuo

Copy link
Copy Markdown
Member

问题

一批中文文档的 frontmatter title 是早期机翻残留:正文是中文,标题却是乱码英文。挑几个最离谱的:

现在 应该是
213.Hiccup II 213. 打家劫舍 II
Sword finger Offer II 021. Delete the countdown of the linked list n Node.md 剑指 Offer II 021. 删除链表的倒数第 n 个结点
2679.In the matrix and the harmony.md 2679. 矩阵中的和
76Minimum cover string.md 76. 最小覆盖子串
One question daily 2293. Great mini game 2293. 极大极小游戏

("打家劫舍"被译成了 Hiccup,"剑指" 被译成了 Sword finger。)

还有一批标题干脆把文件名连 .md 后缀一起塞了进去,另有一篇的 title: >- 折叠标量跨了三行。

title 是页面 <h1><title>sitemap.xml、站内搜索索引、以及 #395 新加的 /llms.txt 索引的取值来源,所以这批坏标题同时在坑读者和坑搜索/AI 抓取。

修法

正确标题不需要外部查询,仓库自己就有:

  • 30 篇description 已经写成 LeetCode <编号>. <中文标题> 题解 — …lib/seo-description.ts 那轮补全的产物),直接从里面取
  • 3 篇从文件名里的中文还原

description 比文件名更可信:[121]买卖股票的最佳时期_translated.md 文件名写的是"最佳时",description 里是官方译名"最佳时",取了后者。

影响面

  • 只改 title,其余 frontmatter(docId / abbrlink / tags / date一个字节没动
  • .en.md 英文版保持英文标题,未触碰
  • diff 是 33 files / +33 / −35(多出的 2 个删除来自那个三行折叠标量收成一行)
  • 33 篇全部通过 YAML 解析校验;prettier 对正文零改动
  • 67/67 测试通过,check-imagescheck-frontmatter-description 通过

另外 26 处被粗筛标记但故意没动RAGPPOCUDAPyTorchTransformerCareerCMake 这类本来就该是英文的标题。

没做的事

这些文件的正文同样是机翻残留,例如:

Today's daily question is too difficult,So find the problem by yourself。

而且部分 _translated.md 与已存在的 .en.md 内容重复(如 1004_translated.md vs 1004-max-consecutive-ones-iii.en.md),等于中文站在提供机翻英文正文。那是内容架构层面的事,需要人决定是重译、合并还是删除,本 PR 不碰。

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings August 2, 2026 20:06
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
involutionhell-github-io Canceled Canceled Aug 2, 2026 8:49pm
website-preview Ready Ready Preview Aug 2, 2026 8:49pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes incorrect/machine-translated frontmatter title values across a batch of Chinese LeetCode docs so that page <h1>, <title>, sitemap/search indexing, and /llms.txt indexing reflect accurate Chinese titles.

Changes:

  • Corrected 33 docs’ frontmatter title values (mostly restoring from existing description or filename), including fixing cases where .md was mistakenly included or where YAML folded scalars broke the title.
  • Normalized titles to consistently include the problem number + correct Chinese name where applicable.
  • Updated generated/doc-contributors.json’s generatedAt timestamp.

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
content/docs/career/interview-prep/leetcode/1004_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/1234. 替换子串得到平衡字符串_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/142.环形链表II_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/1653. 使字符串平衡的最少删除次数_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/1664生成平衡数组的方案数_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/1825求出 MK 平均值_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/1828统计一个圆中点的数目_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/219_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2293_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2299强密码检验器II_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2309兼具大小写的最好英文字母_translated.md Fix broken folded-scalar title to single-line Chinese
content/docs/career/interview-prep/leetcode/2335. 装满杯子需要的最短总时长_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2341. 数组能形成多少数对_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2639. 查询网格图中每一列的宽度_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/2679.矩阵中的和_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/3072. 将元素分配到两个数组中 II_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/345. 反转字符串中的元音字母_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/538.把二叉搜索树转换为累加树_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/6323. 将钱分给最多的儿童_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/76最小覆盖子串_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/80_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/9021_TUT_3_25T1.md Remove .md suffix from title value
content/docs/career/interview-prep/leetcode/994.腐烂的橘子_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/Counting Stars-Inter-Uni Programming Contest.md Remove .md suffix from title value
content/docs/career/interview-prep/leetcode/[121]买卖股票的最佳时期_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[1333]餐厅过滤器_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[146]LRU 缓存_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[213]打家劫舍 II_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[2490]回环句_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[2562]找出数组的串联值_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/[2582]递枕头_translated.md Fix frontmatter title to correct Chinese
content/docs/career/interview-prep/leetcode/brief_alternate 作业帮忙_translated.md Remove incorrect English/misleading title and restore proper one
content/docs/career/interview-prep/leetcode/剑指 Offer II 021. 删除链表的倒数第 n 个结点_translated.md Fix frontmatter title to correct Chinese
generated/doc-contributors.json Refresh generated timestamp metadata

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

这批文档的 frontmatter title 是早期机翻残留,正文是中文、标题却是
乱码英文,最离谱的几个:

  213.Hiccup II                    → 213. 打家劫舍 II(打嗝…)
  Sword finger Offer II 021. …     → 剑指 Offer II 021. 删除链表的倒数第 n 个结点
  2679.In the matrix and the harmony.md → 2679. 矩阵中的和
  76Minimum cover string.md        → 76. 最小覆盖子串

title 是页面 <h1> 和 <title>、sitemap.xml、站内搜索索引、以及新加的
/llms.txt 索引的取值来源,所以这批坏标题同时在坑人和坑搜索/AI 抓取。
还有一批标题干脆把文件名连 .md 后缀一起塞了进去。

正确标题不用外部查询,仓库自己就有:
- 30 篇的 description 已经写成 "LeetCode <编号>. <中文标题> 题解 — …"
  (lib/seo-description.ts 那轮补全的产物),直接从里面取
- 3 篇从文件名里的中文还原

description 比文件名更可信:[121] 那篇文件名写的是"最佳时期",
description 里是官方译名"最佳时机",取了后者。

只改 title,其余 frontmatter(docId / abbrlink / tags / date)一个字节没动,
.en.md 英文版保持英文标题不动。33 篇全部通过 YAML 解析校验。

注:这些文件的正文同样是机翻残留("Today's daily question is too difficult,
So find the problem by yourself。"),且部分与 .en.md 重复;那是另一件事,
本次不碰。
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.

2 participants