If you've tried to build a multilingual site with Astro, you know the pain.
Astro is incredible for static sites. Fast, flexible, developer-friendly. But the moment you need two or more languages, things get complicated quickly.
You end up with duplicated page files, hardcoded locale prefixes, manual slug management, and a growing pile of workarounds that make your codebase harder to maintain with every new page.
We hit this wall building otro.digital — a fully bilingual English/Spanish site with translated URLs, a knowledge base, blog, case studies, and dozens of pages. Existing i18n solutions either didn't work with Astro 5's new Content Layer API, required dynamic rendering (killing the static performance advantage), or simply didn't handle translated URL slugs.
So we built our own. And today, we're releasing it as an open-source package: astro-i18n-next.
What It Does
astro-i18n-next is a complete internationalization integration for Astro 5 static sites. One createI18n() call in your Astro config, and you get:
Translated URL Routing
Your English /about/ page automatically becomes /es/sobre/ — no catch-all routes, no duplicated files, no manual path wiring. Define slug translations right in your page files:
// src/pages/about.astro
export const slugs = { es: 'sobre' };
The integration discovers these at build time and generates all the locale-prefixed routes for you.
A Single Virtual Import
Instead of importing helpers from five different files, everything comes from one place:
import { t, localePath, switchLocalePath } from 'virtual:i18n';
t() for translations (powered by i18next), localePath() for building locale-aware URLs, switchLocalePath() for language switchers. Clean, predictable, no boilerplate.
Multilingual Markdown
Write both languages in a single markdown file using simple locale markers:
---
title:
en: "Getting Started"
es: "Primeros pasos"
---
Your English content here.