ai-i18n-tools
v1.8.3
Published
Unified internationalization toolkit for Node.js apps and documentation with AI translation
Maintainers
Readme
ai-i18n-tools
English (UK) · Deutsch · Español · Français · हिन्दी · 日本語 · 한국어 · Português (Brasil) · 简体中文 · 繁體中文
Translate your app and documentation with the AI model of your choice — no lock-in, no rewrites.
CLI and toolkit for internationalizing JavaScript/TypeScript apps and documentation sites (VitePress, Starlight, Docusaurus, Nextra, Fumadocs, Astro, plain Markdown/MDX). Use built-in presets for OpenAI, Anthropic, Gemini, OpenRouter, Ollama, and more — or any OpenAI-compatible API. Switch provider or model per project or per locale without changing your codebase.
Features
| | |
| --- | --- |
| UI strings | Extract t("…") from JS/TS/Astro (and data-i18n* in HTML) → flat per-locale JSON |
| Documents | Translate Markdown, MDX, and .astro pages for major doc frameworks |
| JSON | Translate nested locale bundles when copy lives outside t() calls |
| SVG | Translate illustrated SVG labels via translate-svg |
| Smart cache | Shared SQLite cache — only new or changed segments hit the model |
| One sync | Runs extract → UI → SVG → docs → JSON in the right order from one config |
Which pipeline?
| Your content | Command |
| --- | --- |
| Source uses t() or HTML markers | UI strings — extract / translate-ui |
| Localized pages or docs sites | Documents — translate-docs |
| Standalone nested JSON locale files | JSON — translate-json |
See What is ai-i18n-tools? for a full comparison.
Install
ESM-only. Requires Node.js >=22.16.0.
pnpm add ai-i18n-tools
# or: npm install ai-i18n-toolsSet an API key for your provider (default init uses OpenRouter; Ollama needs none):
export OPENROUTER_API_KEY=sk-or-v1-your-key-hereConfigure the bare ai-i18n-tools command (direnv, PATH, package.json scripts, or npx) — see Installation.
Quick start
ai-i18n-tools init [-P <provider>] # scaffold config (default: UI strings)
ai-i18n-tools sync # extract + translate per featuresDocs-oriented scaffolds: -t ui-docusaurus, ui-starlight, ui-vitepress, ui-nextra, ui-fumadocs, ui-astro-website, or ui-json-bundles.
Prefer sync over chaining individual translate commands. Full walkthrough: Quick start.
Documentation
- Documentation site — guides, integrations, and reference
- Installation · Quick start · Providers and models
- UI strings · Documents · JSON · SVG
- Integrations — VitePress, Nextra, Fumadocs, Docusaurus, Astro
- CLI reference · Configuration · Runtime helpers
- Examples — runnable demos (
npx degit …) - AI Agent Context — integration guide for assistants in consumer repos
Contributing
Issues and pull requests are welcome. Maintainer workflows for this repository: AGENTS.md and dev/DEVEL.md.
License
MIT — see LICENSE.
Copyright © 2026 Waldemar Scudeller Jr.
