// Base catalog — the source of truth for this app's UI strings. Every key here // MUST be mirrored in `de.ts` (and any other locale); `defineLocale()` // enforces that parity at build time, so a missing translation fails typecheck // rather than silently falling back. // // Messages use ICU syntax: `{name}` placeholders and rich tags like // `` (rendered by passing a matching function to // ` {c} }} />`). import { defineCatalog } from '@voltro/i18n' export default defineCatalog({ // Browser tab titles + descriptions — locale-aware via each page's // `meta({ locale })`. These are plain lookups (not ICU-formatted), so the // `{{capProjectName}}` scaffold token is fine here. 'meta.ssr.title': '{{capProjectName}} — SSR (fresh per request)', 'meta.ssr.description': 'Server-rendered on every request.', 'meta.isr.title': '{{capProjectName}} — ISR (cached + revalidated)', 'meta.isr.description': 'Cached HTML, revalidated on a window.', 'meta.swr.title': '{{capProjectName}} — stale-while-revalidate', 'meta.swr.description': 'Serve stale instantly, refresh in the background.', // ---- Layout shell (pages/layout.tsx) ---- // Route + render-mode labels — technical tokens, identical across locales. 'nav.ssr': '/ (ssr)', 'nav.isr': '/feed (isr)', 'nav.swr': '/feed-swr (isr + swr)', 'lang.label': 'Language', // ---- Shared field labels ---- 'field.renderedAt': 'Rendered at', 'field.nonce': 'Nonce', // ---- SSR page (pages/index.tsx) ---- 'ssr.badge': 'renderMode: ssr', 'ssr.heading': 'Fresh on every request', 'ssr.lead': 'Refresh — the timestamp and nonce change each time.', 'ssr.field.acceptLanguage': 'Accept-Language', 'ssr.field.themeCookie': 'voltro:theme cookie', 'ssr.note': 'SSR responses carry x-voltro-rendered-by: ssr and are never cached. This page needs a runtime — serve it with voltro start, not a bare CDN.', // ---- ISR page (pages/feed.tsx) ---- 'isr.badge': 'renderMode: isr · revalidate 10s', 'isr.heading': 'Cached, then revalidated', 'isr.lead': 'Refresh twice fast — same nonce (cache HIT). Wait 10s+, refresh — fresh nonce.', 'isr.field.tenant': 'Tenant (from x-tenant)', 'isr.note': 'Watch the response headers: x-voltro-cache: MISS on the first request (it rendered), then HIT within the window, then MISS again after it expires. With tenantAware: true the cache key includes x-tenant.', // ---- ISR + stale-while-revalidate page (pages/feed-swr.tsx) ---- 'swr.badge': 'renderMode: isr · revalidate 5s · swr 30s', 'swr.heading': 'Stale-while-revalidate', 'swr.lead': 'Fresh first; HIT within 5s; STALE (instant) from 5–35s while a background refresh runs.', 'swr.note': 'The response header tells you which path served the page: x-voltro-cache: MISSHITSTALE (background refresh) → MISS again after the SWR window.', } as const)