Layout that follows the language
Text grows and flips direction. getLocaleDirection tells you which way.
Open-source i18n libraries, a CLI and an AI translation service for React, Next.js, Vue, React Native, TanStack Start, Node and Python.
Not on npm yet. Install from source · the hosted service is free while in preview.
Sample translations written for this page · formatted live with @generic-translation/core · real content hashes
Each step is a separate tool you can use on its own.
01 · Code
02 · Context
03 · Translations
04 · Automation
Locale-aware formatting, layout direction and routing come with the libraries.
Text grows and flips direction. getLocaleDirection tells you which way.
Small wrappers over Intl with cached formatters.
1.249,50 € · 30 novembre 2026
Next.js middleware: path, then cookie, then Accept-Language, then the default.
/abouten/es/aboutes/fr/aboutfr/FR/about→ /fr/about/en/about→ /aboutlocalePrefix: "as-needed" (also "always" and "never").
Runs entirely in your browser: no account, no network request.
The hash is the first 32 hex characters of a SHA-256 over the message, and is the key Generic Translation stores translations under. Read about the message format or how hashing works.
From a single CLI command to pull requests that open themselves.
Connect a project to a repository and the agent reads your config, extracts messages, translates them and opens a pull request. No workflow file.
Needs a GitHub App registered by the instance owner, which has not been done on the hosted preview yet.
Works with every stack
A self-contained build of the CLI: no npm install, one secret.
Keys, front matter, markup and timestamps are preserved while the prose is translated.
Everything the CLI and dashboard do goes through a public REST API.
The CMS connectors have only run against fakes built from each service's documentation.
Machine translation is only as good as what it is told.
Context goes to the model with the string and is part of its hash.
Pin a translation per locale, or keep a term as written everywhere.
| term | 🇪🇸 es | 🇩🇪 de | 🇫🇷 fr |
|---|---|---|---|
| Generic Translation | do not translate | ||
| workspace | espacio de trabajo | Arbeitsbereich | espace de travail |
| invoice | factura | Rechnung | facture |
Audience, tone and formality, sent with every translation.
A note-taking app for small teams. Friendly and concise. Informal “you” (tú, du, tu). Never translate the product name.
Each language gets the plural forms its grammar needs.
Every string has a status: machine, edited or approved. Turn on requires review and only approved strings are published.
| source | 🇪🇸 es | status |
|---|---|---|
| Save changes | Guardar cambios | approved |
| Closecontext: button that dismisses a dialog | Cerrar | approved |
| {count, plural, one {# file} other {# files}} | {count, plural, one {# archivo} other {# archivos}} | edited |
| Welcome back, <0>{name}</0>. | Hola de nuevo, <0>{name}</0>. | machine |
curl https://generic-translation-api.jacobfv123.workers.dev/v1/projects/current/translate \
-H "authorization: Bearer $GENERIC_TRANSLATION_API_KEY" \
-H "content-type: application/json" \
-d '{
"targetLocale": "fr",
"requests": [{ "source": "Save {count, plural, one {# file} other {# files}}" }]
}'$ generic-translation translate # extract, translate, write the maps
Found 64 messages in 12 files (88 scanned)
es public/_generic-translation/es.json 64 messages
fr public/_generic-translation/fr.json 64 messages
Done. 64 messages × 2 locales.
# illustrative output; a second run reports "nothing new to submit"Regional variants, served from a CDN or shipped with your build.
Translate into a language or a regional variant. Glossary lookups fall back from pt-BR to pt.
Publish one JSON map per locale, public with ETag and Cache-Control, or let the CLI write files into your repo.
GET /cdn/{projectId}/es.jsoncdnpublic/_generic-translation/es.jsonlocalThe libraries and CLI are MIT licensed. The API is one Cloudflare Worker you can deploy to your own account.
Self-hosting guide → The API source is not public yet; the guide says what you need.
The Next.js quickstart takes a fresh app to a translated page in a handful of steps. Free while in preview.