feat(i18n): scaffold svelte-i18n with en/es/de locales and language selector

initI18n (src/lib/i18n/index.ts) registers three locales and picks the
initial one in order: kon_locale in localStorage > navigator.language short
code > en. +layout.svelte calls it once at app boot; guarded so per-window
re-init is a no-op.

Locale files are deliberately sparse — this is a scaffolding pass so strings
can be migrated incrementally. The Settings → Appearance → Language picker
plus its own description is the first real consumer; everything else
continues to render as hardcoded text until extracted.

Also: split the @chenglou/pretext ambient shim into src/lib/shims.d.ts. The
declaration previously lived in app.d.ts alongside a top-level `export {}`,
which made app.d.ts a module — scoping `declare module` to its own imports
and breaking resolution from src/lib/utils/textMeasure.ts. The fresh
.svelte-kit sync triggered by installing svelte-i18n surfaced it. Ambient
shim files must stay script-scoped (no top-level imports/exports).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-21 07:49:03 +01:00
parent 4c0c876ade
commit b8baa65bd2
10 changed files with 906 additions and 41 deletions

View File

@@ -0,0 +1,19 @@
{
"settings": {
"title": "Einstellungen",
"language": "Sprache",
"languageDescription": "Oberflächensprache von Kon. Wirkt sich nicht auf die Transkription aus."
},
"history": {
"title": "Verlauf",
"empty": "Noch keine Transkripte — drück das Kürzel und leg los."
},
"tasks": {
"title": "Aufgaben"
},
"dictation": {
"ready": "Bereit",
"recording": "Aufnahme…",
"processing": "Verarbeitung…"
}
}

View File

@@ -0,0 +1,19 @@
{
"settings": {
"title": "Settings",
"language": "Language",
"languageDescription": "Kon's interface language. Affects labels, not transcription."
},
"history": {
"title": "History",
"empty": "No transcripts yet — press the hotkey and start talking."
},
"tasks": {
"title": "Tasks"
},
"dictation": {
"ready": "Ready",
"recording": "Recording…",
"processing": "Processing…"
}
}

View File

@@ -0,0 +1,19 @@
{
"settings": {
"title": "Ajustes",
"language": "Idioma",
"languageDescription": "Idioma de la interfaz de Kon. No afecta a la transcripción."
},
"history": {
"title": "Historial",
"empty": "Sin transcripciones todavía — pulsa el atajo y empieza a hablar."
},
"tasks": {
"title": "Tareas"
},
"dictation": {
"ready": "Listo",
"recording": "Grabando…",
"processing": "Procesando…"
}
}