Build a Multilingual Next.js App in 5 Minutes with App Router

Published: (March 2, 2026 at 05:21 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

TL;DR

A production‑ready Next.js 15 + App Router i18n starter template with server‑side translations, instant locale switching, and 15 languages out of the box.

GitHub Repo | Live Demo

Highlights

  • ⚡ Next.js 15 with App Router and Server Components
  • 🌍 15 pre‑configured languages (EN, TR, DE, ES, FR, JA, KO, ZH, AR, RU, IT, NL, HI, PL, PT)
  • 🔄 Instant locale switching – no full page reload
  • 🖥️ SSR translations – no flash of untranslated content
  • 📦 Cloud‑managed translations via better‑i18n CDN
  • 🎨 Tailwind CSS 4 + shadcn/ui components
  • 🔍 SEO‑ready – hreflang tags, Open Graph, JSON‑LD schemas, sitemap

Step 1: Clone and install

npx create-next-app -e https://github.com/better-i18n/nextjs-i18n-starter my-i18n-app
cd my-i18n-app

Step 2: Configure the project

  1. Create a free project at .
  2. Add the languages you need.
  3. Set the environment variable:
echo 'NEXT_PUBLIC_BETTER_I18N_PROJECT=your-org/your-project' > .env

Step 3: Run the development server

npm run dev
# Open http://localhost:3000

You now have a multilingual Next.js app.

Core files

i18n.config.ts

import { createI18n } from "@better-i18n/next";

export const i18n = createI18n({
  project: process.env.NEXT_PUBLIC_BETTER_I18N_PROJECT || "better-i18n/demo",
  defaultLocale: "en",
  localePrefix: "always",
});

middleware.ts

import { i18n } from "./i18n.config";

export default i18n.betterMiddleware();

One line handles locale detection, redirects, and path prefixing.

src/app/[locale]/layout.tsx

export default async function LocaleLayout({ children, params }) {
  const { locale } = await params;
  const messages = await i18n.getMessages(locale);

  return (
    
      
        
          {children}
        
      
    
  );
}

Translations load server‑side from the CDN, are passed to the provider, and become available everywhere via useTranslations().

Example page

// src/app/[locale]/pricing/page.tsx
import { useTranslations } from "next-intl";

export default function PricingPage() {
  const t = useTranslations("pricing");
  return 
## {t("title")}
;
}

Add your translation keys in the better‑i18n dashboard; the page works in all languages automatically.

Build & Deploy

npm run build

Push the repository to GitHub and connect it to Vercel for automatic deployments. The starter works out of the box on Vercel with zero configuration.

Resources

If you find this useful, please ⭐ the repository!

0 views
Back to Blog

Related posts

Read more »

Did Your Project Really Need Next.js?

Introduction Recently, I’ve been seeing more and more teams migrating projects from Next.js to TanStack. Cases like Inngest, which reduced local dev time by 83...