Skip to content

整合 ​

框架整合參考資料:它們的共通點以及 shell 字串的差異。若要為網站新增語言,請從為網站或文件網站新增 i18n開始。若要為應用程式新增語言,請從為 JS/TS 應用程式新增 i18n、為 Python 應用程式新增 i18n或為 .NET 應用程式新增 i18n開始。若要為儲存庫的 README 和其他 Markdown 檔案新增語言,請從為您的 README 和 Markdown 文件新增 i18n開始。

文件整合使用 文件 管線 (translate-docs / sync) 來處理頁面內容;在註明之處,外殼字串 (導覽、側邊欄、主題) 會於同一個管線內處理 — 而非透過獨立的 JSON 管線。Python 應用程式使用 UI 字串 管線 (extract / translate-ui)。

閱讀哪份指南 ​

選擇器表格(每個框架有一個初始化範本)位於 將 i18n 新增至網站或文件網站 中。該頁面上的逐步解說提示會啟用該框架的 i18n 功能。下方的整合頁面保留了 shell-catalog 的詳細資訊。Python 框架:Python。

共用概念 ​

文件框架整合共用 Documents 中所述的相同 docs[] 區塊模型。請將 docsOutput.style 設定為符合您的框架 ("docusaurus"、"vitepress"、"nextra"、"fumadocs" 或 "astro-starlight")。關於輸出資料夾配置與連結重寫行為,請參閱 Output layouts 與 Link rewriting。Python 的設定方式則為獨立項目:Python。

每個 init -t ui-* -P <provider> 骨架會寫入該預設的 LLM 供應商區塊。在 translate-docs 或 sync 之前,請設定對應的 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
Streamlitexamples/python-streamlit
Flaskexamples/python-flask
FastAPIexamples/python-fastapi
GNU gettextexamples/python-gettext
.NET JSON 輔助程式examples/dotnet-console
.NET ResourceManager 輔助程式examples/dotnet-resx

採用 MIT 授權條款釋出。