fix: fully apply language when switching via URL hash

- Reload lesson modules in new language
- Re-render sidebar module list
- Update progress display
- Now #de, #pl etc. properly translate entire UI
This commit is contained in:
2026-01-15 20:57:08 +01:00
parent a03aa09570
commit 3bfe7a5b01

View File

@@ -1941,6 +1941,11 @@ function handleRoute(shouldUpdateUrl = true) {
// Switch language and redirect to home
setLanguage(route.lang);
applyTranslations();
// Reload modules in new language and re-render sidebar
const langModules = loadModules(route.lang);
lessonEngine.setModules(langModules);
renderModuleList(elements.moduleList, langModules, selectModule, selectLesson);
updateProgressDisplay();
history.replaceState(null, "", window.location.pathname);
showLandingPage();
return; // Skip updateNavHighlight/updatePageMeta since we're redirecting