When we set out to rebuild navetteforyou.com — a private transfer booking site for Marrakech — we had a non-negotiable requirement: serve genuine, useful content in eight languages (English, French, Spanish, German, Italian, Portuguese, Dutch, and Arabic) without any client-side routing overhead.
Here's how we did it with Astro, and what we learned about multilingual static sites along the way.
Why Astro for a Multilingual Transport Site
Astro's file-based routing and static-first philosophy made it the natural choice. Each language gets its own URL prefix (/en/, /fr/, /ar/, etc.), and every page is pre-rendered at build time. No JavaScript framework ships to the browser for routing — the server does all the work at build time, and the CDN serves plain HTML.
For a transport booking site where SEO matters enormously (guests search in their native language for "transfert aéroport Marrakech" or "Flughafentransfer Marrakesch"), this architecture means every locale gets its own crawlable, indexable URL with zero hydration cost.
File Structure: One Content Layer, Eight Outputs
Our content lives in a single source of truth:
src/content/
├── routes/ # Route data (origin, destination, distances)
├── translations/ # Per-locale UI strings
│ ├── en.ts
│ ├── fr.ts
│ ├── ar.ts
│ └── ...
└── site.ts # Brand constants (phone, email, operator name)
Astro's dynamic routes generate every locale variation at build time:
src/pages/
├── [locale]/
│ ├── index.astro
│ ├── [route].astro
│ └── guides/
│ └── [...slug].astro
The [locale] parameter maps to our eight supported languages. At build time, Astro generates 633 static HTML pages — every route in every language.
hreflang: Telling Search Engines About Language Variants
Every page includes a complete set of hreflang link tags in the <head>:
<link rel="alternate" hreflang="en" href="https://www.navetteforyou.com/en/airport-transfer" />
<link rel="alternate" hreflang="fr" href="https://www.navetteforyou.com/fr/transfert-aeroport" />
<link rel="alternate" hreflang="de" href="https://www.navetteforyou.com/de/flughafentransfer" />
<link rel="alternate" hreflang="ar" href="https://www.navetteforyou.com/ar/نقل-المطار" />
<link rel="alternate" hreflang="x-default" href="https://www.navetteforyou.com/en/airport-transfer" />
The x-default tag points to English as the fallback for users whose language isn't in our supported set.
We generate these programmatically in a shared <Head> component, looping through every locale and building the correct slug for each language. This ensures perfect consistency — you can't forget a language or mistype a URL, because it's all derived from the same route data.
RTL Arabic Support with CSS Logical Properties
Arabic (ar) is our only right-to-left language. Instead of maintaining a separate stylesheet, we use CSS logical properties throughout:
.card {
margin-inline-start: 1rem;
padding-inline-end: 0.5rem;
border-inline-start: 3px solid var(--accent);
}
Combined with dir="rtl" on the <html> element for Arabic pages, the entire layout flips automatically. No JavaScript, no separate build, no conditional classes.
The Astro layout component checks the locale and sets the direction:
<html lang={locale} dir={locale === 'ar' ? 'rtl' : 'ltr'}>
Static Generation Benefits for SEO
The numbers speak for themselves:
- 633 pages generated at build time
- Zero JavaScript for routing (Astro islands only where needed, like the booking widget)
- Sub-second TTFB from Vercel's edge network
- Perfect Lighthouse accessibility scores across all locales
- 17,113 price points validated by an automated pre-deploy check that ensures no pricing error ships
Every page carries structured data (Schema.org JSON-LD) in the correct language, with the operator entity linked via sameAs to our profiles across platforms.
The Translation Workflow
Each locale file exports a typed object:
// src/content/translations/fr.ts
export const fr = {
hero: {
title: "Transfert Privé à Marrakech",
subtitle: "Réservez votre chauffeur privé",
},
booking: {
cta: "Réserver maintenant",
whatsapp: "Contacter sur WhatsApp",
},
// ...
} satisfies TranslationSchema;
The satisfies keyword ensures every locale implements the same shape. Missing a key? TypeScript catches it at build time, not in production.
What We'd Do Differently
Slugs. We started with translated URL slugs (/fr/transfert-aeroport vs /en/airport-transfer), which is great for SEO but adds complexity. If starting fresh, we'd evaluate whether the SEO benefit outweighs the routing complexity for smaller sites.
Content negotiation. We don't do automatic language detection — the user picks their language, and we remember it. For a transport site where guests often share links with travel companions who speak different languages, stable URLs matter more than auto-detection.
The Stack
- Framework: Astro (static output)
- Hosting: Vercel (edge CDN)
- Languages: 8 (en, fr, es, de, it, pt, nl, ar)
- Pages: 633 at last build
- Client JS for routing: 0 bytes
Operated by Serenity Morocco Tours — visit navetteforyou.com to see it in action, or reach us on WhatsApp at +212 701 664 704.
This is a real production site, not a demo. The architecture handles real bookings for guests arriving in Marrakech daily.
Top comments (0)