What problem does it solve?
This Skill solves the problem of building an Astro website that supports multiple languages with consistent URLs, automatic locale handling, and user language persistence.
Core Features & Use Cases
- Built-in i18n routing setup: Configure locales, default locale, and locale URL prefix behavior for predictable multilingual navigation.
- Locale detection and fallback logic: Use cookie/URL/header-aware prioritization (cookie first, then browser language via middleware when needed, then default).
- Translation system for UI text: Store language-specific strings in typed TypeScript modules and render text via a translation helper function.
- Cookie-based language persistence: Provide a language picker that updates a lang cookie so the selected language remains stable across navigation.
- Use Case: When you have a bilingual marketing site, implement consistent navigation labels and page headings (including header/footer text) so that switching to /en/ reflects throughout the UI.
Quick Start
Configure astro.config.mjs with your locales and defaultLocale, then create src/i18n/ui.ts and src/i18n/utils.ts and update your .astro components to render all user-visible strings through the translation helper.