Skip to content

What is ai-i18n-tools? ​

ai-i18n-tools is a command-line tool and toolkit that helps you translate your app and documentation using your preferred LLM provider. You control everything from a single config file, choosing which translation features to enable. Use the "sync" command to run the modes you need in one go.

Translation modes ​

  • UI strings — Extract t("…") calls (and similar markers) from JS/TS source and write flat per-locale JSON files for i18next or static lookup. Commands: extract, translate-ui. Guide: UI strings.
  • Documents — Translate Markdown, MDX, and .astro pages listed in docs[].contentPaths. Works with VitePress, Starlight, Docusaurus, Nextra, Fumadocs, Astro, and other static doc sites. Command: translate-docs. Guide: Documents.
  • JSON — Translate nested JSON locale bundles (theme labels, i18n overrides, app copy not in source) defined in top-level json[]. Command: translate-json. Guide: JSON.
  • SVG — Translate visible text inside SVG illustrations (<text>, <title>, <desc>) and write one output file per locale. Separate from document translation — translate-docs does not modify SVG assets. Command: translate-svg. Guide: SVG translation.

All four modes use the active LLM provider, share the same config file, and reuse a SQLite cache so reruns only send new or changed text to the model.

Which should I use? ​

Your contentModeCommand
Source code uses t() or HTML data-i18n markersUI stringsextract / translate-ui
Localized pages or doc sitesDocumentstranslate-docs
Standalone nested JSON locale filesJSONtranslate-json
Diagrams or illustrations with labels in SVGSVGtranslate-svg

Many projects combine modes — for example UI strings plus documents for a VitePress site, or documents plus SVG for illustrated guides. See Quick start for scaffold templates and Configuration for the full config schema.

Examples ​

The repository ships runnable example projects under examples/ — each with its own config, committed locale outputs, and README. You can explore translated files without an API key; re-running translation requires a provider key (see Providers and models).

ExampleWhat it shows
console-appSmallest end-to-end app: t() UI strings plus README translation
nextjs-appNext.js UI, plurals, SVG, nested Docusaurus docs, flat README, dashboard
docusaurus-docsStandalone Docusaurus documentation site
astro-websiteAstro marketing site: full-page HTML translation plus t() strings
astro-docsAstro Starlight documentation site
vitepress-docsVitePress docs plus theme catalog
nextra-docsNextra docs plus _meta.ts sidebar labels and theme dictionary
fumadocs-docsFumadocs docs plus meta.json sidebar labels and UI catalog
plain-htmlStatic HTML with data-i18n* markers and locale JSON
multi-providerCompare LLM providers on the same document
test-markdownMarkdown pipeline stress tests (CJK, Devanagari, edge cases)
intlayer-migrationIntlayer .content.ts → t() via migrate-intlayer

See Examples for npx degit copy commands and a choosing guide.

Next steps ​

  1. Installation — install the package and set your provider API key.
  2. Quick start — scaffold a config and run your first translation.
  3. Providers and models — choose a provider, model fallback chain, and -P override.

Released under the MIT License.