AstroStarter

astro-i18n-starter — Astro Starter Template

By Scorpio3310

An Astro-based multilingual website starter template that demonstrates a complete implementation of URL localization and content translation, with blog, form, and component examples.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

Demonstrates multilingual SEO-friendly URLs, such as /about and /sl/o-projektu each localized

02

Centralized route configuration (src/i18n/routes.ts) manages path mappings for each language

03

Namespaced translation system and context-preserving language switching

04

Multilingual blog system with posts and pagination

05

Contact page form example using Astro Actions for localized validation

06

Svelte 5 interactive component examples and ARIA accessibility attributes

Template Details

This is an Astro starter template for multilingual sites. Astro does not include URL localization out of the box; this template uses dynamic routing and centralized route configuration to show how different languages can have their own localized URLs, for example English /about corresponding to Slovenian /sl/o-projektu.

The template includes language-specific content loading, a namespaced translation system, context-preserving language switching, a multilingual blog with pagination, a contact form example with localized validation using Astro Actions, plus Svelte component examples and ARIA accessibility attributes. Content is managed with Astro Content Collections, styling uses Tailwind CSS, and images are processed through Astro Assets.

By default it uses the Cloudflare adapter to support on-demand rendering for dynamic routes, and the build output includes a Cloudflare Worker and static assets; the README explains how to replace it with another adapter. The repository also has a helper-based branch that provides a dynamic default language and optional language prefixes, which is a more advanced variant.

Before use, you need to copy the environment variable file and set PRODUCTION_DOMAIN, which is used to generate Open Graph images, canonical links, and robots.txt. The template includes English and Slovenian by default, and adding new pages requires updating the route configuration, translation files, and navigation data together.

AstroStarter

Is it right for your project?

Use Cases

  • Websites that need localized URLs for different languages rather than only translated content
  • Projects built with Astro that need a multilingual blog and pagination
  • Developers who want a reference for how i18n routing, translation files, and navigation data are organized in Astro
  • Multilingual sites that need form localization validation and interactive component examples

Suitable For

  • Developers building multilingual sites with Astro
  • Teams that need a reference for URL localization approaches
  • Projects planning to deploy on Cloudflare and requiring dynamic routing
  • Individuals or commercial projects that want to start from MIT-licensed code

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    After cloning the repository, install dependencies with pnpm install

  2. 2

    Copy .env.example to .env and set PRODUCTION_DOMAIN to your production domain

  3. 3

    Run pnpm run dev to start the development server, accessible by default at http://localhost:4321

  4. 4

    The build output is a Cloudflare Worker (dist/server) and static assets (dist/client), deployable with pnpm exec wrangler deploy; changing hosts requires replacing the adapter in astro.config.mjs

  5. 5

    Adding new pages requires updating src/i18n/routes.ts, the translation files under src/locales/, and src/data/navigationData.ts together

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version in the public repository under the MIT license; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • You may use, modify, commercialize, and distribute the code of this version for free.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • By default it uses the Cloudflare adapter to support on-demand rendering for dynamic routes; it can be replaced with another adapter, but changing hosts requires modifying the astro.config.mjs configuration yourself.
  • Before use, you must copy .env.example to .env and set PRODUCTION_DOMAIN to your production domain; this variable is used to generate Open Graph images, canonical links, and robots.txt.
  • The build output is a Cloudflare Worker and static assets, and the default deployment method relies on Cloudflare's wrangler toolchain.
  • Advanced features such as a dynamic default language and optional language prefixes are provided in another helper branch, not in the default branch.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur separate charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

Adapter**: [Cloudflare](https://docs.astro.build/en/guides/integrations-guide/cloudflare/) - SSR adapter for dynamic routes (you can use any other adapter)

Original README

Edit .env with your production domain PRODUCTION_DOMAIN = "https://your-domain.com"

Original README

`pnpm run build` produces a Cloudflare Worker (`dist/server`) plus static assets (`dist/client`), as configured in `wrangler.jsonc`. Deploy it with `pnpm exec wrangler deploy`.

Original README

These items are maintained in the advanced helper‑based branch:

Original README
https://github.com/Scorpio3310/astro-i18n-starter/blob/main/LICENSEhttps://github.com/Scorpio3310/astro-i18n-starter/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 87 / 100
Technologies
Astro
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-09-13
Screenshot last checked
2026-10-02

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Astro as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: 42f8b638fa0dad92a99f015dfa6f53b94474d13a14ead4dbf451acedd873e952

2026-10-02T16:09:10.446Z

Source file / repository
# Astro i18n Starter

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Astro](https://img.shields.io/badge/Astro-7.3.2-purple.svg)

**Keywords:** `astro` • `i18n` • `internationalization` • `multilingual` • `url localization` • `seo` • `typescript` • `tailwind css` • `static site generation`

## 🌐 [Live Demo](https://astro-i18n-starter.klemenc.dev)

> Multilingual Astro starter with URL localization support. Complete documentation available at the demo link.

Since Astro doesn't have built-in URL localization out of the box, this starter demonstrates how to implement a complete i18n solution for multilingual projects.

---

> [!TIP]
>
> ## 🚀 Advanced Variant
>
> Looking for a more advanced setup? Check the helper‑based branch (slightly more complex):
>
> - Dynamic default language
> - Optional language prefix
>   Link: [https://github.com/Scorpio3310/astro-i18n-starter/tree/feat/i18n-routing-helper](https://github.com/Scorpio3310/astro-i18n-starter/tree/feat/i18n-routing-helper)

---

## ✨ Features

This project implements a comprehensive internationalization (i18n) system that includes:

- ✅ **SEO-friendly URLs** in multiple languages (`/about` → `/sl/o-projektu`)
- ✅ **Static + on-demand rendering** - Static generation at build time with on-demand rendering for dynamic routes
- ✅ **Language-specific content** loading and management
- ✅ **Translation system** integration with namespace support
- ✅ **Smart language switching** with context preservation
- ✅ **Blog system** with multilingual posts and pagination
- ✅ **Form handling example** - Contact page demonstrates Astro Actions with localized validation
- ✅ **Component examples** with Svelte 5 integration
- ✅ **Accessibility features** with proper ARIA attributes
- ✅ **SEO optimization** with meta tags and keywords

**Perfect for:** Projects requiring complete URL localization alongside content translation

![Overview](public/github-image.jpg)

---

## 🛠️ Tech Stack

- **Framework**: [Astro 7.3](https://astro.build/) - Static site generator
- **Adapter**: [Cloudflare](https://docs.astro.build/en/guides/integrations-guide/cloudflare/) - SSR adapter for dynamic routes (you can use any other adapter)
- **Components**: [Svelte 5](https://svelte.dev/) - Interactive components with runes
- **Styling**: [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS
- **Content**: Astro Content Collections - Type-safe markdown content
- **Images**: Astro Assets - Optimized image processing

---

## 🚀 Quick Start

### 1. Clone & Install

```bash
# Clone the repository
git clone https://github.com/Scorpio3310/astro-i18n-starter.git
cd astro-i18n-starter

# Install dependencies
pnpm install
```

### 2. Environment Setup

```bash
# Copy environment file
cp .env.example .env

# Edit .env with your production domain
PRODUCTION_DOMAIN = "https://your-domain.com"
```

### 3. Development Server

```bash
# Start development server
pnpm run dev
```

Visit `http://localhost:4321` to see your multilingual site!

---

## 📁 Project Structure

```
/
├── public/              # Static assets
├── src/
│   ├── assets/          # Assets
│   ├── components/      # Reusable components
│   ├── content/         # Content collections (blog, authors)
│   ├── data/            # Navigation and configuration
│   ├── i18n/            # Translation utilities and routes
│   ├── layouts/         # Page layouts
│   ├── locales/         # Translation files (en, sl)
│   ├── pages/           # File-based routing with [dynamic] params
│   ├── styles/          # Global styles
│   └── utils/           # Utility functions
```

---

## 🌍 How URL Localization Works

The system uses dynamic routing with file-based structure:

```
English:    /about          → src/pages/[about]/[...index].astro
Slovenian:  /sl/o-projektu  → src/pages/[about]/[...index].astro
```

**Route Configuration:**

```typescript
// src/i18n/routes.ts
// The default language (en) keeps the original route names and is not listed here
export const routes = {
    sl: { about: "o-projektu", blog: "spletni-dnevnik" },
};
```

**Dynamic Path Generation:**

```astro
export function getStaticPaths() {
  return [
    { params: { about: "about", index: undefined }, props: { lang: "en" } },
    { params: { about: "sl", index: "o-projektu" }, props: { lang: "sl" } },
  ];
}
```

---

## 📝 Adding New Pages

1. **Create page file**: `src/pages/[your-route]/[...index].astro`
2. **Add route translations**: Update `src/i18n/routes.ts`
3. **Add translations**: Create files in `src/locales/en/` and `src/locales/sl/`
4. **Update navigation**: Modify `src/data/navigationData.ts`

Detailed documentation with examples is available in the demo site.

---

## 🔧 Environment Variables

```bash
# .env
PRODUCTION_DOMAIN = "https://your-domain.com"  # Used to enable robots.txt
```

**Important:** Set your production domain for proper:

- Open Graph images in social media
- Canonical URLs for SEO
- Search engine indexing control

---

## 🚢 Deployment

### Build for Production

```bash
pnpm run build
```

### Preview Build

```bash
pnpm run preview
```

`pnpm run build` produces a Cloudflare Worker (`dist/server`) plus static assets (`dist/client`), as configured in `wrangler.jsonc`. Deploy it with `pnpm exec wrangler deploy`. To target another host, swap the adapter in `astro.config.mjs`.

---

## 📋 Roadmap

These items are maintained in the advanced helper‑based branch:

- [x] ~~Dynamic default language~~
- [x] ~~Optional language prefix~~

updates: https://github.com/Scorpio3310/astro-i18n-starter/tree/feat/i18n-routing-helper

---

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Test locally with `pnpm run build && pnpm run preview`
5. Commit your changes (`git commit -m 'Add amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request

---

## 📄 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## 🙏 Acknowledgments

- [Astro](https://astro.build/) - Amazing static site generator
- [Svelte](https://svelte.dev/) - Excellent component framework
- [Tailwind CSS](https://tailwindcss.com/) - Great utility CSS framework
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.