Skip to content

Examples ​

Runnable projects under examples/ on GitHub — 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 (Providers and models).

Run standalone (npx degit) ​

Copy one example without cloning the full repository.

Node.js examples ​

Each Node.js example declares a published caret range of ai-i18n-tools matching the current package version and installs the CLI from npm:

bash
npx degit wsj-br/ai-i18n-tools/examples/<name> <name>
cd <name>
pnpm install

Python examples ​

python-streamlit, python-flask, python-fastapi, and python-gettext have no package.json. The degit commands in the table below are valid. You can also download ai-i18n-tools-python-examples.zip from the GitHub Release. That zip is the same four directories. It is not part of the npm package, and it is not inside the standalone executable.

python-streamlit, python-flask, and python-fastapi use a virtualenv and pip install -r requirements.txt. python-gettext uses only the standard library. Translate with the standalone executable.

bash
npx degit wsj-br/ai-i18n-tools/examples/python-streamlit python-streamlit
cd python-streamlit
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

On Windows, activate .venv\Scripts\activate.

If you cloned the whole ai-i18n-tools repository instead, run pnpm install and pnpm run build at the repository root, then cd examples/<name>. Workspace (Node.js) examples use the local CLI via their pnpm run i18n:* scripts, or bare ai-i18n-tools … after PATH setup. Python examples in that checkout translate with node ../../bin/ai-i18n-tools.mjs after the build. See Installation — Cloned monorepo.

Which example matches my project? ​

List of Examples ​

ExampleBest forCopy with degitRun
console-appSmallest working app with t() UI strings + README translationnpx degit wsj-br/ai-i18n-tools/examples/console-app console-apppnpm start
nextjs-appReact / Next.js + plurals + dashboard; nested Docusaurus docs + flat README + SVG assetsnpx degit wsj-br/ai-i18n-tools/examples/nextjs-app nextjs-apppnpm dev (app :3030; cd docs-site && pnpm start for docs :3040)
docusaurus-docsDocusaurus documentation site only (docusaurus preset)npx degit wsj-br/ai-i18n-tools/examples/docusaurus-docs docusaurus-docspnpm start (:3100; build + serve, locale menu works)
astro-websiteAstro landing page: full-page HTML + t() hybridnpx degit wsj-br/ai-i18n-tools/examples/astro-website astro-websitepnpm dev
astro-docsAstro Starlight documentation sitenpx degit wsj-br/ai-i18n-tools/examples/astro-docs astro-docspnpm dev (:3050)
vitepress-docsVitePress docs site + theme JSON (pt-BR, zh-Hans)npx degit wsj-br/ai-i18n-tools/examples/vitepress-docs vitepress-docspnpm run docs:dev (:3060)
nextra-docsNextra 4 MDX + _meta.ts / dictionary .ts shell, plus one t() server component (pt-BR, zh-Hans)npx degit wsj-br/ai-i18n-tools/examples/nextra-docs nextra-docspnpm run dev (:3070)
fumadocs-docsFumadocs 4 MDX + meta.json / UI catalog (pt, zh, dot parser)npx degit wsj-br/ai-i18n-tools/examples/fumadocs-docs fumadocs-docspnpm run dev (:3080)
plain-htmlPlain HTML + data-i18n* markers; static locale JSON (dashboard-style UI)npx degit wsj-br/ai-i18n-tools/examples/plain-html plain-htmlpnpm dev (:3090)
plain-html-docsPlain HTML as documents: one page per locale, localized images, hreflangnpx degit wsj-br/ai-i18n-tools/examples/plain-html-docs plain-html-docspnpm dev (:3092)
multi-providerPick or benchmark an LLM provider (-P / --provider)npx degit wsj-br/ai-i18n-tools/examples/multi-provider multi-providerai-i18n-tools translate-docs -P openai --force
test-markdownRegression-test markdown / CJK translation (Devanagari, MDX)npx degit wsj-br/ai-i18n-tools/examples/test-markdown test-markdownpnpm build
intlayer-migrationIntlayer .content.ts → t() (migrate-intlayer, reset + AI-agent report)npx degit wsj-br/ai-i18n-tools/examples/intlayer-migration intlayer-migrationpnpm reset && pnpm dev (:3091)
intlayer-translateKeep Intlayer, fill missing locales in place (translate-intlayer; en + pt-BR shipped, es + zh-Hans missing)npx degit wsj-br/ai-i18n-tools/examples/intlayer-translate intlayer-translatepnpm reset && pnpm translate (pnpm dev :3093)
python-streamlitStreamlit dashboard, t() / _(), source-string JSONnpx degit wsj-br/ai-i18n-tools/examples/python-streamlit python-streamlitpython3 -m venv .venv && pip install -r requirements.txt && streamlit run app.py
python-flaskFlask + Jinja, t() / _(), source-string JSONnpx degit wsj-br/ai-i18n-tools/examples/python-flask python-flaskpython3 -m venv .venv && pip install -r requirements.txt && flask --app app run
python-fastapiFastAPI, ContextVar locale, t() / _(), source-string JSONnpx degit wsj-br/ai-i18n-tools/examples/python-fastapi python-fastapipython3 -m venv .venv && pip install -r requirements.txt && uvicorn app:app
python-gettextExisting GNU gettext CLI; extract / translate-ui refresh .po and .monpx degit wsj-br/ai-i18n-tools/examples/python-gettext python-gettextpython3 app.py --lang es

Each Example name links to its GitHub README with full setup, commands, and project layout — or browse the examples index in the repository.

Node.js examples install the CLI from npm after pnpm install. The four Python examples use venv and pip (python-gettext uses only the standard library) and the standalone executable for translation.


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.

Released under the MIT License.