Nexanexa
Step 6

Internationalization

A special [locale] route segment, plus t("key") in the body, seo and schema — resolved against src/locales/<locale>.json. This very tutorial you're reading uses exactly this mechanism.

The [locale] segment

src/pages/[locale]/index.tsx   ->  /es, /en, ...

pages/[locale]/index.tsx is served at /es, /en, or any locale you have under src/locales/.

Translating with t()

// src/locales/en.json
{ "home": { "title": "Welcome to Nexa" } }

// src/pages/[locale]/index.tsx
export default function Home() {
    return <h1>{t("home.title")}</h1>;
}

t("key") recognizes one exact syntactic pattern: an identifier t with a single string literal — no interpolation, no dynamic key.

Automatic hreflang

<link rel="alternate" hreflang="es" href="/es">
<link rel="alternate" hreflang="en" href="/en">

When more than one locale is available, Nexa generates the <link rel="alternate" hreflang="..."> for every translation automatically.