Split i18n catalogues into per-domain modules

sv.ts/en.ts were single 602-line files that every feature had to edit,
making concurrent work on unrelated screens collide constantly. Split
both into per-domain modules (common, auth, calendar, dashboard,
settings, plan, wishEditor, tips) composed by an index that preserves
the existing `import { sv } from './sv'` specifier, so no consumer
changes.

Typing still catches drift in both directions: each en module is checked
against TranslationKey, and the composed catalogue must satisfy
Record<TranslationKey, string>.

All 433 keys and their values are byte-identical to the originals,
verified by diffing the parsed catalogues against the pre-split files.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RXMhc9nT6sNz1SL4j8dznL
This commit is contained in:
2026-09-14 18:54:27 +02:00
parent 7f031f2087
commit bd996245ba
20 changed files with 1017 additions and 1204 deletions
+32
View File
@@ -0,0 +1,32 @@
import { common } from './common'
import { auth } from './auth'
import { calendar } from './calendar'
import { dashboard } from './dashboard'
import { settings } from './settings'
import { plan } from './plan'
import { wishEditor } from './wishEditor'
import { tips } from './tips'
/**
* Swedish message catalogue — the single source of truth for translation keys.
*
* Split into per-domain modules so unrelated features can add keys without
* editing the same file. `en/` mirrors this structure exactly and is typed
* against `TranslationKey`, so a key present in one locale and missing from
* the other is a compile-time (`npm run typecheck`) error.
*
* These strings were extracted verbatim from the components that previously
* hardcoded them — this file is the authoritative Swedish copy.
*/
export const sv = {
...common,
...auth,
...calendar,
...dashboard,
...settings,
...plan,
...wishEditor,
...tips,
} as const
export type TranslationKey = keyof typeof sv