UI strings
Extract t() calls from JS, TS, and Astro. Generate flat per-locale JSON for i18next or static SSG lookup.
Extract t() strings, translate Markdown, MDX, JSON bundles, and SVG labels — all from one config, with OpenAI, Anthropic, Gemini, OpenRouter, Ollama, or any OpenAI-compatible API. Switch models per project or per locale without rewriting your codebase.
The published package is ESM-only. Node.js >=22.16.0 required.
pnpm add ai-i18n-tools
# Set API key for your active provider — see preset table (default init: openrouter)
export OPENROUTER_API_KEY=sk-or-v1-your-key-here
ai-i18n-tools init [-P <provider>]
ai-i18n-tools syncSee Installation for configuring the bare CLI command (including cloned-monorepo development) and Quick start for scaffold templates.
| Your content | Command |
|---|---|
Source code uses t() | UI strings — extract / translate-ui |
| Localized pages or docs sites | Documents — translate-docs |
| Standalone nested JSON locale files | JSON — translate-json |
SVG illustrations use a separate translate-svg path — not docs[].contentPaths. See What is ai-i18n-tools? for a full comparison.
-P overridesai-i18n-tools.config.json schemanpx degitIntegrating the package into your own project? Start with AI Agent Context. The repository README is a short GitHub/npm landing page that links here for detail.
Disclaimer
Product names and icons belong to their respective owners and are used for identification purposes only. This software is not affiliated with or endorsed by those brands.
All interface and documentation languages except English (UK) were translated with AI using this package (ai-i18n-tools); the wording may be imprecise or contain errors.