How does SvelteKit handle internationalization (i18n)?

Answer

SvelteKit doesn't have built-in i18n but integrates well with libraries. Paraglide.js (by Inlang, built for SvelteKit): compile-time i18n with tree-shaken translations — each page only includes the strings it uses. Uses a messages/ folder with JSON locale files. No runtime overhead. svelte-i18n: runtime i18n with stores, plural forms, and date/number formatting. URL-based locale routing: the recommended pattern — prefix routes with locale: /en/about, /de/about. Implement in hooks.server.js: detect locale from URL, set in event.locals, make available to load functions. Redirect root / based on Accept-Language header. SvelteKit route groups: src/routes/[lang]/ with a layout that validates the locale param. Static prerendering: prerender each locale separately for maximum performance. export const prerender = true; export function entries() { return SUPPORTED_LOCALES.map(lang => ({ lang })); }.