diff --git a/frontend/src/lib/components/Admin/Translations.svelte b/frontend/src/lib/components/Admin/Translations.svelte index 3cedc5ca..3d179bc3 100644 --- a/frontend/src/lib/components/Admin/Translations.svelte +++ b/frontend/src/lib/components/Admin/Translations.svelte @@ -20,10 +20,19 @@ import de from "../../../locales/de.json"; type Translation = Record>; let translations = $state({} as Record); +function fillMissingSections(translation: Translation): Translation { + for (const section_key in de) { + if (!(section_key in translation)) { + translation[section_key] = {}; + } + } + return translation; +} + async function refreshTranslations() { for (const lang_id of $locales) { if (lang_id !== "de") { - translations[lang_id] = await getI18nJson(lang_id); + translations[lang_id] = fillMissingSections(await getI18nJson(lang_id)); } } }