Next.js
Integrate i1n with Next.js using next-intl or the i1n SDK directly.
Setup
Run i1n init in your Next.js project. The CLI auto-detects next-intl if present and configures nested JSON format in your locales/ directory.
i1n works with both the App Router and Pages Router. You can use the i1n SDK in standalone mode or connect it to next-intl via Bridge Mode.
Standalone Mode
Import init and t from i1n, load your translation resources, and use t() directly in your components. The auto-generated i1n.d.ts file provides full type safety and IDE autocomplete.
This approach replaces next-intl entirely. Use init() to load resources and setLocale() to switch languages. No additional i18n library is required.
Bridge Mode with next-intl
If your project already uses next-intl, connect it to i1n with a single line: registerI1n((key, params) => nextIntlT(key, params)). This preserves your existing next-intl setup while adding i1n's type-safe autocomplete.
i1n manages the translation files, AI translation, and type generation. next-intl continues to handle runtime loading, server components, and routing. You get the benefits of both systems with zero migration cost.
Deployment
Add i1n pull to your build step or CI/CD pipeline to ensure translations are always in sync before deployment.
Next.js static generation (SSG) and server-side rendering (SSR) both work seamlessly with i1n-managed translation files.
import { t } from 'i1n'
export default function HomePage() {
return (
<main>
<h1>{t('home.title')}</h1>
<p>{t('home.subtitle')}</p>
</main>
)
} import { registerI1n } from 'i1n'
import { useTranslations } from 'next-intl'
const t = useTranslations()
registerI1n((key, params) => t(key, params))