feat: add URL-based language switching (#de, #pl, #es, #ar, #uk)

- Visit #de to switch to German and go to home
- Visit #pl for Polish, #es for Spanish, #ar for Arabic, #uk for Ukrainian
- Language is persisted to localStorage
- URL is cleaned up after switching (hash removed)
This commit is contained in:
2026-01-15 17:47:20 +01:00
parent 8b8e5a19ad
commit a03aa09570
2 changed files with 20 additions and 1 deletions

View File

@@ -1937,6 +1937,13 @@ function handleRoute(shouldUpdateUrl = true) {
case RouteType.LESSON:
navigateToLesson(route.moduleId, route.lessonIndex, shouldUpdateUrl);
break;
case RouteType.LANGUAGE:
// Switch language and redirect to home
setLanguage(route.lang);
applyTranslations();
history.replaceState(null, "", window.location.pathname);
showLandingPage();
return; // Skip updateNavHighlight/updatePageMeta since we're redirecting
default:
showLandingPage();
}