fixed language issues, updated routing, completed first version of managment page

This commit is contained in:
Henri
2026-04-07 23:55:38 +03:00
parent ae1a44b65f
commit 3d27217769
11 changed files with 208 additions and 558 deletions

View File

@@ -13,11 +13,18 @@ export function navigate(path, options = {}) {
if (external) {
window.open(path, '_blank', 'noopener,noreferrer');
} else {
window.history.pushState({}, "", path);
const selectedLang =
localStorage.getItem('language') ||
getLanguageFromRoute(window.location.pathname) ||
'est';
const resolvedPath = getTranslatedRoute(path, selectedLang);
window.history.pushState({}, "", resolvedPath);
window.dispatchEvent(new PopStateEvent('popstate'));
// Update language based on new route
const lang = getLanguageFromRoute(path);
const lang = getLanguageFromRoute(resolvedPath);
if (lang) {
switchLang(lang);
}