One i18n setup for any TypeScript project
Same config. Same API. Use AI Gateway or local Ollama models across Next.js, Astro, React, TanStack Router, and plain Node. No rewrites.
export const landingTranslationsConfig = {
availableLocales: ["en", "es"] as const,
defaultLocale: "en",
fallbackLocale: "en",
messages: { en, es },
} as const;
const translator = await configureTranslations(landingTranslationsConfig);
const { t } = createTranslationHelpers(translator);
t("hero.title") // -> "One i18n setup for any TypeScript project."
t("hero.descriptionParam", {
params: {
param1: "value1",
}
}) // -> localized copy param
t("header.language", {
locale: "es"
}) // -> "Idioma"
t("Write source strings", { bt: true }) // -> auto-extracted & keyed by CLISame config everywhere
Switch frameworks without rewriting your i18n setup
bun add @better-translate/corebun add @better-translate/astrobun add @better-translate/corebun add @better-translate/corebun add @better-translate/reactbun add @better-translate/nextjsbun add @better-translate/tanstack-router