Skip to content

集成

将 ai-i18n-tools 接入文档站点和 Astro 项目的框架专属指南。每个集成均使用 文档 管道(translate-docs / sync)处理页面内容;外壳字符串(导航、侧边栏、主题)在注明的情况下也在同一管道中处理——而非通过独立的 JSON 管道。

阅读哪个指南

你的站点初始模板从这里开始
Astro Starlight 或原生 Astroui-starlight / 混合 UI 字符串Astro
Docusaurusui-docusaurusDocusaurus
VitePressui-vitepressVitePress
Nextra 4(Next.js App Router)ui-nextraNextra
Fumadocs 4(Next.js App Router)ui-fumadocsFumadocs

共享概念

所有文档框架集成均共享 文档 中所述的相同 docs[] 块模型。请将 docsOutput.style 设置为与你的框架相匹配("docusaurus""vitepress""nextra""fumadocs""astro-starlight")。有关输出文件夹布局和链接重写行为,请参见 输出布局链接重写

每个 init -t ui-* 模板都会生成一个默认的 LLM 提供商块(除非你传入 -P <provider>,否则为 openrouter)。在 translate-docssync 之前,如有需要请配置 provider / providers 并设置相应的 API 密钥 — 参见提供商和 API 密钥

有关跨框架比较,请参阅框架外壳翻译。下方链接的每个指南均涵盖相应框架的设置。

框架外壳翻译

框架外壳/主题字符串管道
Docusauruswrite-translations 目录 ({ message, description })文档 — docs[].docusaurusCatalogDir + translate-docs
VitePress主题/导航/侧边栏目录文档 — docsOutput.vitepressThemeCatalog + translate-docs
Nextra_meta.ts 侧边栏标签文档 — 当 style: "nextra" + translate-docs 时自动
Nextra主题字典 .ts文档 — docs[].nextraDictionaryPath + translate-docs
Fumadocsmeta.json 侧边栏标签文档 — 当 style: "fumadocs" + translate-docs 时自动
FumadocsUI 覆盖目录文档 — docsOutput.fumadocsUiCatalog + translate-docs
Astro Starlight内置 UI 字符串(多语言支持);无额外外壳管道文档 — translate-docs(仅页面)

不要将框架外壳/主题字符串放入 json[] — 该流水线用于无关的应用程序语言包。各框架的设置详情请参阅从阅读哪份指南链接的指南。

可运行示例

框架示例仓库
Astro Starlightexamples/astro-docs
原生 Astro 网站examples/astro-website
Docusaurusexamples/docusaurus-docs
VitePressexamples/vitepress-docs
Nextraexamples/nextra-docs
Fumadocsexamples/fumadocs-docs

基于 MIT 许可证发布。