Internationalization
Type-safe translations, pluralization, date/number formatting, and language switching with Paraglide JS.
Language Switcher
Detection order: URL prefix → Cookie → Base locale (English)
Current language: English (en)
Formatting locale: en-US
Translated Messages
Pluralization
ICU MessageFormat handles pluralization rules per language.
Date & Number Formatting
Formatting uses the browser's Intl API, decoupled from the translation locale. A German user in Switzerland gets German text but Swiss number formatting.
Content Translation (Database)
The tc() helper translates JSON fields from the database, falling back through: current locale → English → first available.
Database Schema Pattern
// JSON columns for translated content
title: jsonb('title').$type<Record<string, string>>()
// Data: { "en": "Hello", "de": "Hallo", "fr": "Bonjour" }Type Safety
All message keys are compile-time checked with full IntelliSense support. Missing keys or wrong parameters cause build errors, not runtime errors.
Compile-time Guarantees
// ✅ Type-safe with autocomplete
m.greeting({ name: 'Alice' });
// ❌ Compile error — missing parameter
m.greeting();
// ❌ Compile error — unknown message key
m.unknownKey();