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:
@@ -1941,6 +1941,11 @@ function handleRoute(shouldUpdateUrl = true) {
|
|||||||
// Switch language and redirect to home
|
// Switch language and redirect to home
|
||||||
setLanguage(route.lang);
|
setLanguage(route.lang);
|
||||||
applyTranslations();
|
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);
|
history.replaceState(null, "", window.location.pathname);
|
||||||
showLandingPage();
|
showLandingPage();
|
||||||
return; // Skip updateNavHighlight/updatePageMeta since we're redirecting
|
return; // Skip updateNavHighlight/updatePageMeta since we're redirecting
|
||||||
|
|||||||
Reference in New Issue
Block a user