Menu

Deploying an 8-Language Astro Site to Vercel: Lessons from 5000+ Static Routes
📰

Deploying an 8-Language Astro Site to Vercel: Lessons from 5000+ Static Routes

DEV Community: astro·Marrakech Transport·about 19 hours ago
#fP7JQA5Q
#devtoastro#devto#dev#locale#build
Reading 0:00
15s threshold

The Scale

Our Marrakech transfer site serves content in eight languages: English, French, Spanish, German, Italian, Portuguese, Dutch, and Arabic (RTL). Multiply that by 80+ route pages, excursion pages, activity pages, guide articles, and utility pages, and you hit 5,000+ static routes at build time.

Locale Architecture

Each locale gets its own URL prefix except English (the default):

export const LOCALES = [ { code : "en" , dir : "ltr" , hreflang : "en" } , { code : "fr" , dir : "ltr" , hreflang : "fr" } , { code : "ar" , dir : "rtl" , hreflang : "ar" } , // ... 5 more ] ;

Enter fullscreen mode

Exit fullscreen mode

A single splitLocalePath function handles routing: /fr/transfers/essaouira resolves to { locale: "fr", pathname: "/transfers/essaouira" } . English paths have no prefix.

Translation Dict Pattern

Each locale has a folder of TypeScript modules ( dict/fr/routes.ts , dict/fr/ui.ts ).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.