docs(zh): 补全剩余文档的简体中文翻译,并新增 AI 翻译提示#1622
Open
chenglu wants to merge 36 commits into
Open
Conversation
Introduce an AiTranslationNotice banner shown on pages whose Chinese translation was produced with AI assistance, inviting readers to review and contribute corrections on GitHub. - Add AiTranslationNotice component (lib/src/components/common) - Render it in DocLayout when frontmatter has `ai-translated: true`, linking to the page source for review - Style `.alert-ai-translation` variant in _alert.scss - Fix translator gulp tasks to tolerate missing legacy paths (allowEmpty) so the mono export pipeline runs on the Jaspr output Co-authored-by: Cursor <cursoragent@cursor.com>
Add Simplified Chinese translations for the remaining untranslated documentation, following the established bilingual convention: the English source is preserved and the Chinese translation is appended directly beneath it, keeping the original structure and indentation so upstream updates remain easy to diff and re-translate. Covers content under ui/, platform-integration/, cookbook/, ai/, learn/, testing/, app-architecture/, tools/, install/ and others, plus shared _includes snippets. Pages translated with AI assistance are flagged with `ai-translated: true` in frontmatter. Excludes the release/ notes and DevTools release-notes by request. Co-authored-by: Cursor <cursoragent@cursor.com>
- offline-first.md: restore the API client paragraph block that was garbled during translation (duplicated lines and a truncated `<?code-excerpt` directive), fixing the "Invalid code excerpt syntax" build error - create-new-app.md: add the missing `[ij-set-org]` link reference definition and its Chinese translation, fixing the broken Markdown link reference reported by check-link-references Both `check-link-references` and `refresh-excerpts --fail-on-update` now pass locally. Co-authored-by: Cursor <cursoragent@cursor.com>
The `[ai-toolkit]` reference definition was changed from the correct `/ai-toolkit` to `/ai/toolkit` during translation, producing a 404 in the internal link checker. Restore the upstream path. Co-authored-by: Cursor <cursoragent@cursor.com>
Translating the footnotes produced duplicate `[^n]:` definitions and a duplicated `[^4]` reference across the English and Chinese table rows. After the mono (Chinese-only) export folds away the English row, the `fnref-4` backref anchor disappeared, tripping the internal link checker with a "missing anchor" warning. - Collapse each footnote into a single definition with the English text preserved and the Chinese translation as an indented continuation - Follow the established bilingual convention (see architectural-overview) of commenting out the footnote marker on the English row (`<!-- [^4] -->`) so the live anchor lives on the retained Chinese row Verified: after build + translator mono export, all footnote backrefs resolve to existing anchors. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
Author
|
预览: https://docs-ai-translation-preview.flutter.cn/ 谢谢 cursor 老师,谢谢中转站老师。 |
- Convert Chinese list items from separate `* **中文**` entries to properly indented continuation paragraphs within the English list item (65 instances across 20+ files) - Fix duplicate headings where API names like `HtmlElementView` appeared identically in both English and Chinese rows (add descriptive suffixes) - Replace mechanical "允许你" (allows you) with natural "让你" phrasing (44 instances) All changes verified: build passes, check-link-references and refresh-excerpts both clean. Co-authored-by: Cursor <cursoragent@cursor.com>
…iners Translation agents incorrectly produced separate English and Chinese :::note/tip/warning blocks, causing the page to render two identical admonition boxes. Merged 82 consecutive block pairs into unified bilingual containers (English content + Chinese translation in a single ::: block), matching the established convention. Also fixes 6 remaining list formatting issues in property-editor.md. Co-authored-by: Cursor <cursoragent@cursor.com>
Distilled from real production issues encountered during batch translation of 295 files. Covers formatting rules, common pitfalls (duplicate tip blocks, list items, footnotes, headings), quality standards, self-check procedures, and terminology glossary. Co-authored-by: Cursor <cursoragent@cursor.com>
修复 markdown 列表中中文翻译的格式问题:
- 有序列表:移除中文翻译行前的 `1. ` 前缀,改为缩进续行
- 无序列表:移除中文翻译行前的 `- ` / `* ` 前缀,改为缩进续行
修复前(错误,会渲染为嵌套子列表):
1. English text
1. 中文翻译
修复后(正确,中文作为同一列表项的续行):
1. English text
中文翻译
共修复 84 个文件,588 处问题。
Co-authored-by: Cursor <cursoragent@cursor.com>
- 移除 2./3./4. 等编号前缀(之前只处理了 1.) - 修复中文翻译行缩进不足导致 markdown 结构被破坏的问题 (如 link reference 因缩进错误未被识别) Co-authored-by: Cursor <cursoragent@cursor.com>
…in-flutter-n-dart.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
补全 docs.flutter.cn 上剩余未翻译文档的简体中文翻译,并新增「本页内容由 AI 翻译」提示,邀请读者参与校阅。
按既有的中英对照惯例处理:保留英文原文,将中文译文直接追加在对应英文下方,维持原有结构与缩进,便于上游更新时人工 diff、仅更新对应中文。
改动内容
本 PR 拆成两个 commit,方便分别 review:
1.
docs(zh):翻译内容(约 280 个文件)ui/、platform-integration/、cookbook/、ai/、learn/、testing/、app-architecture/、tools/、install/等目录,以及共享的_includes/片段ai-translated: truerelease/发版说明与 DevTools release-notes(按约定排除)2.
feat(docs):AI 翻译提示功能AiTranslationNotice组件(lib/src/components/common)DocLayout中检测 frontmatter 的ai-translated: true时渲染提示横幅,并链接到该页源文件,方便校阅_alert.scss新增.alert-ai-translation样式allowEmpty),使纯中文导出流程能在 Jaspr 产物上运行测试
dart run dash_site build构建成功(716 页,无错误)tool/translator/build.sh的 inject + export --mono 流程,验证:英文原文正确折叠、中文完整保留、AI 提示横幅在译文页正常显示<li>),确保翻译工具能正确折叠说明
ai-translated为本 PR 新引入的 frontmatter 字段,由上述 layout 逻辑识别,对未标记的页面无影响。Made with Cursor