ACTIVATE when implementing multilingual Astro sites, language switching, translated routes, or translation patterns. ACTIVATE for 'i18n', 'multilingual', 'language switch', 'hreflang', 'translate route', 'getLang'. Covers: prefix-based routing (fr default, /en prefix), route mapping between languages, translation dictionary without external library, multilingual content collections, hreflang SEO tags, language switcher component. DO NOT use for: Astro routing basics (see astro-routing), SEO tags (see astro-seo).
From astronpx claudepluginhub fabiensalles/claude-marketplace --plugin astroThis skill uses the workspace's default tool permissions.
references/i18n-implementation-patterns.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Configures Istio traffic management with VirtualServices, DestinationRules for routing, canary/blue-green deployments, circuit breakers, load balancing, and fault injection in service meshes.
Patterns for building multilingual Astro sites without external libraries.
src/pages/
├── index.astro # / (French default)
├── about.astro # /about
├── blog/
│ └── [...slug].astro # /blog/*
└── en/
├── index.astro # /en
├── about.astro # /en/about
└── blog/
└── [...slug].astro # /en/blog/*
// src/utils/i18n.ts
export function getLang(pathname: string): 'fr' | 'en' {
return pathname.startsWith('/en') ? 'en' : 'fr';
}
export function getLocalizedPath(path: string, lang: 'fr' | 'en'): string {
const cleanPath = path.replace(/^\/en/, '');
return lang === 'en' ? `/en${cleanPath}` : cleanPath;
}
When implementing route mapping between languages (static or dynamic), read
references/i18n-implementation-patterns.mdfor complete mapping implementations.
When setting up a translations dictionary with JSON files and helper functions, read
references/i18n-implementation-patterns.mdfor the full dictionary setup and useTranslations pattern.
When organizing multilingual content collections (separate collections, prefixed slugs, or frontmatter-based), read
references/i18n-implementation-patterns.mdfor all three approaches.
When building a language switcher component or multilingual navigation, read
references/i18n-implementation-patterns.mdfor complete LanguageSwitcher.astro and nav patterns.
| French | English | Pattern |
|---|---|---|
/ | /en | Homepage |
/blog | /en/blog | Section |
/blog/mon-slug | /en/blog/my-slug | Content |
/formations | /en/training | Translated route |
| Function | Purpose |
|---|---|
getLang(path) | Extract language from URL |
t(key, lang) | Get translation |
translateRoute(path, lang) | Convert path to other language |
getLocalizedPath(path, lang) | Add/remove language prefix |
| Tag | Purpose |
|---|---|
<html lang=""> | Document language |
hreflang links | Language alternates |
og:locale | Social sharing language |
x-default | Default/fallback version |