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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user