@nabulingo/translate
The same engine that powers our WordPress & Shopify plugins — now as an npm package for your Next.js, React, Astro, or static-gen project.
npm install @nabulingo/translateBuilt for real production sites
Not a runtime widget. Not a translation memory spreadsheet. A proper build-time i18n system that fits the way you already ship.
Build-time, not runtime
Translations are baked into static HTML. Zero API cost per page view, zero latency, perfect CDN caching.
SEO-first
Automatic hreflang tags, per-locale canonical URLs, og:locale metadata. Google ranks every version independently.
Human-review aware
Mark translations as {"reviewed": true} and the tooling never overwrites them — even with --force. Pair AI speed with human polish.
Pluggable providers
Anthropic Claude, DeepL, OpenAI, or the NabuLingo cloud. Use your own keys, or your NabuLingo site token.
Tiny API
<T>Hello</T> or useT(). TypeScript-safe, AST-extracted, no runtime codegen step.
Framework-ready
First-class Next.js (App Router) support. Astro, SvelteKit, and Remix adapters on the roadmap.
5-minute quickstart
From zero to a Next.js site serving 9 languages with SEO-clean URLs.
- 1
Install and initialize
npm install @nabulingo/translate
npx nabulingo initCreates
nabulingo.config.mjsand amessages/folder. - 2
Configure your locales and provider
// nabulingo.config.mjs import { defineConfig } from "@nabulingo/translate"; export default defineConfig({ sourceLocale: "en", locales: ["de", "fr", "es", "it", "nl"], // Option A: use our cloud (one bill for WP + Shopify + npm) provider: { type: "nabulingo", siteToken: process.env.NABU_SITE_TOKEN }, // Option B: bring your own keys // provider: { type: "anthropic", apiKey: process.env.ANTHROPIC_API_KEY }, tone: { de: "formal", fr: "formal", es: "informal" }, glossary: { NabuLingo: "NabuLingo" }, }); - 3
Wrap strings in <T> or useT()
import { T, useT } from "@nabulingo/translate/react"; export function Hero({ name }: { name: string }) { const t = useT(); return ( <section> <h1><T>Your personal AI language tutor.</T></h1> <p>{t("Welcome back, {name}!", { name })}</p> </section> ); } - 4
Extract and translate
npx nabulingo extract
npx nabulingo translateScans your code, calls the provider once per new string, writes
messages/de.jsonetc. Commit them to git. - 5
Wire up Next.js routing
// app/[locale]/layout.tsx import { NabuLingoProvider } from "@nabulingo/translate/react"; import { loadDictionary, localeParams, buildAlternates } from "@nabulingo/translate/next"; import config from "../../nabulingo.config.mjs"; export const generateStaticParams = () => localeParams(config); export default async function Layout({ children, params }) { const { locale } = await params; const dictionary = await loadDictionary("messages", locale); return ( <NabuLingoProvider locale={locale} sourceLocale={config.sourceLocale} dictionary={dictionary}> {children} </NabuLingoProvider> ); }
Want to see it live?
This very marketing site has /intl-demo — 18 strings translated into 9 languages at build time by this exact package. Including hreflang, canonical, and og:locale metadata.
vs. other i18n libraries
| next-intl | react-i18next | @nabulingo/translate | |
|---|---|---|---|
| You write the translations | ✓ | ✓ | Optional — AI drafts + you review |
| Build-time static HTML | ✓ | ✓ | ✓ |
| AI-powered by default | — | — | ✓ |
| Integrated translation memory | — | — | ✓ |
| Shared glossary with WP/Shopify | — | — | ✓ |
| hreflang + canonical helpers | — | — | ✓ |
Already using next-intl or react-i18next? You can adopt @nabulingo/translateincrementally — it doesn't take over your whole app.