i18n-system

Configures multi-language Astro sites with core i18n routing, typed dictionaries, and hreflang links.

Updated Jun 17, 2026
One-click install
npx skills add https://github.com/ccediland/web-stack-skills --skill i18n-system-ccediland
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: i18n-system
Source: https://github.com/ccediland/web-stack-skills/tree/main/plugin/skills/i18n-system
Command: npx skills add https://github.com/ccediland/web-stack-skills --skill i18n-system-ccediland

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding a second language to an Astro site on Cloudflare Workers Static Assets involves routing, UI strings, localized content, CMS structure, and hreflang — and most popular i18n libraries are abandoned, deprecated, or built for SSR architectures this stack avoids. This Skill provides the verified zero-dependency approach. ## Core Features & Use Cases - Core i18n routing: Default locale at the URL root with prefixed secondary locales, so existing URLs never break when a language is added. - Typed zero-dependency UI dictionary: Compile-time-checked string keys with default-locale fallback, optionally editable by clients through a Sveltia single_file data collection. - Localized content collections: Per-locale folder layout shared natively by Astro and Sveltia CMS, with canonical_slug linking translations and honest partial-translation handling. - hreflang emission: Per-page alternate links with x-default, plus a verified explanation of why automatic language detection is absent on a static Worker. - Use Case: A client asks to add an English version of their Spanish Astro marketing site. Use this Skill to configure locale routing, set up the string dictionary, structure bilingual blog collections for Sveltia, and emit correct hreflang tags. ## Quick Start Add English as a second language to my Astro site with locale routing, a language switcher, and hreflang tags.

Frequently Asked Questions about i18n-system

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a second language to an Astro site?▼

Configure Astro's built-in i18n in astro.config with locales and defaultLocale, keeping prefixDefaultLocale false so the default locale stays at the root. Add secondary-locale pages under a folder named after the locale, and use astro:i18n URL helpers for all cross-locale links.

What i18n library should I use for Astro?▼

None by default — Astro's core i18n routing plus a typed zero-dependency dictionary module covers most sites. astro-i18next is abandoned in beta and paraglide-astro is deprecated; escalate to @inlang/paraglide-js directly only past roughly 200 string keys or translator workflows.

Can Astro detect the visitor's browser language and redirect automatically?▼

Not on a prerendered static site — Astro.preferredLocale only works on on-demand server routes. On Cloudflare's Free plan, Redirect Rules cannot read Accept-Language and Snippets are unavailable, so the default is no detection, with an optional client-side banner as the ceiling.

How do I localize Astro content collections with a CMS?▼

Put each locale in its own subfolder (src/content/blog/es/, src/content/blog/en/) — this layout is both Astro's i18n recipe and Sveltia CMS's native multiple_folders structure. Link translations with a shared translationKey frontmatter field via Sveltia's canonical_slug feature.

Should I use the Astro sitemap i18n option for hreflang?▼

No — the @astrojs/sitemap i18n option emits xhtml:link alternates without x-default and has undocumented behavior on partially translated sites. Emit head link rel=alternate elements per page from getAbsoluteLocaleUrlList instead, only for locales where the page actually exists.

Does Astro i18n domains work with Cloudflare Workers?▼

No — i18n.domains requires output server with zero prerendered pages and only the node or vercel adapters support it. Locale-per-domain on this stack means separate deployments, so treat tutorials wiring domains as inapplicable.