Astro i18n Starter is a boilerplate for building multilingual Astro websites, implementing complete URL localization so each language gets its own SEO-friendly path (for example, English /about becomes Slovenian /sl/o-projektu).
What is Astro i18n Starter?
Astro i18n Starter is a free, MIT-licensed starter template that gives you a working internationalization setup for Astro 7.1, using Svelte 5 for interactive components, Tailwind CSS for styling, and the Cloudflare adapter for on-demand rendering. It takes translation files, route mappings, and content collections as input, and produces a static site with localized URLs, a multilingual blog, pagination, and a localized contact form. The project is maintained under the GitHub repository Scorpio3310/astro-i18n-starter, with a live demo and documentation hosted at astro-i18n-starter.klemenc.dev.
Key Features
- SEO-friendly URL localization — Each language uses its own translated path names, configured in
src/i18n/routes.ts; dynamic routes map requests to localized slugs. - Static plus on-demand rendering — Pages are statically generated at build time, while dynamic routes use the Cloudflare SSR adapter, which can be swapped for any Astro adapter.
- Translation system with namespace support — Translation files live in
src/locales/enandsrc/locales/sl, and content is loaded per language with type safety. - Smart language switching — The starter preserves the current page context when switching languages, so users stay on the equivalent page in the other language.
- Multilingual blog with pagination — Blog posts are stored in Astro Content Collections with typed Markdown, and the blog section includes pagination across languages.
- Localized form handling example — The contact page demonstrates Astro Actions with validation messages localized per language.
- Accessibility and SEO — ARIA attributes, meta tags, canonical URLs, and Open Graph image support are built in once
PRODUCTION_DOMAINis set. - Component examples with Svelte 5 — Interactive components use Svelte 5 runes, showing how to integrate a component framework into an Astro i18n site.
Who is it for?
Web developers who want to launch a multilingual Astro site without building an i18n routing layer from scratch. Content teams who need a bilingual blog with separate URLs per language. Agencies that need SEO-friendly localized paths for clients. Also useful for teams exploring Svelte 5 integration inside Astro.
Use cases
- Localizing an existing Astro site: Add a second language by editing route mappings and adding translation files, then deploy to any static host.
- Launching a bilingual blog: Use the included content collections and pagination to publish posts in English and Slovenian (or swap in other languages).
- Building localized forms: Start from the contact page example to add Astro Actions forms with per-language validation messages.
- Prototyping multilingual products: Use the starter's structure to quickly test URL localization patterns before scaling up.
How does it work?
To start, clone the repository, run pnpm install, copy .env.example to .env, and set PRODUCTION_DOMAIN to your production URL. The URL localization system works by defining route names per language in src/i18n/routes.ts, then generating static paths with getStaticPaths that include the localized slug. Adding a new page involves creating an Astro file under src/pages/[your-route]/[...index].astro, adding route translations, adding locale files, and updating the navigation data.
Pros and cons
- Pros: Provides a complete i18n setup that Astro doesn't include out of the box; includes both English and Slovenian locale files; supports static and SSR pages; comes with a demo and documentation.
- Cons: Only two languages are pre-configured, so adding more requires manual file creation; advanced options like dynamic default language and optional language prefix are only on a separate helper-based branch.
Pricing
Free and open source under the MIT License.
FAQ
Does Astro i18n Starter work without the Cloudflare adapter?
Yes. The starter uses the Cloudflare adapter for on-demand rendering of dynamic routes, but the documentation states you can use any other Astro adapter in its place.
What languages are included?
English and Slovenian translation files are included, with route mappings for both. The structure supports adding more languages by creating locale files and route definitions.
How do I enable the advanced dynamic default language feature?
The advanced features, including dynamic default language and optional language prefix, are maintained in the helper-based branch referenced in the repository README, not on the main branch.
What is PRODUCTION_DOMAIN used for?
Setting PRODUCTION_DOMAIN in your environment enables robots.txt and controls Open Graph images, canonical URLs, and search engine indexing behavior in the generated site.
Is the template free to use commercially?
Yes, the project is licensed under the MIT License, so you can use it for commercial projects with attribution as required by MIT.








